mirror of
https://github.com/kittywitch/konawall-py.git
synced 2026-02-09 04:19:19 -08:00
feat: add xfce
This commit is contained in:
parent
09b59d8230
commit
dd9ad663ee
2 changed files with 16 additions and 1 deletions
|
|
@ -16,7 +16,7 @@ def detect_linux_environment():
|
|||
"cinnamon", # dconf
|
||||
"mate", # dconf
|
||||
"deepin", # dconf
|
||||
"xfce4", # xfconf
|
||||
"xfce", # xfconf
|
||||
"lxde", # pcmanfm
|
||||
"kde", # qdbus
|
||||
]
|
||||
|
|
|
|||
15
konawall/environments/xfce.py
Normal file
15
konawall/environments/xfce.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import subprocess
|
||||
from konawall.module_loader import add_environment
|
||||
from konawall.imager import combine_to_viewport
|
||||
|
||||
@add_environment("xfce_setter")
|
||||
def set_wallpapers(files: list, displays: list):
|
||||
file = combine_to_viewport(displays, files)
|
||||
command_for_last_image = ["xfconf-query", "--channel", "xfce4-desktop", "--list"]
|
||||
workspaces_command = subprocess.run(command_for_last_image, capture_output=True)
|
||||
workspaces_command_lines = workspaces_command.stdout.decode("utf-8").strip().split("\n")
|
||||
workspaces_command_wallpapers = [conf for conf in workspaces_command_lines if "last-image" in conf]
|
||||
set_command_base = ["xfconf-query", "-c", "xfce4-desktop", "-s", file.name, "-p"]
|
||||
for workspace_config in workspaces_command_wallpapers:
|
||||
set_command = set_command_base + [workspace_config]
|
||||
subprocess.run(set_command)
|
||||
Loading…
Add table
Add a link
Reference in a new issue