feat: add xfce

This commit is contained in:
Kat Inskip 2024-04-06 09:47:22 -07:00
parent 09b59d8230
commit dd9ad663ee
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
2 changed files with 16 additions and 1 deletions

View file

@ -16,7 +16,7 @@ def detect_linux_environment():
"cinnamon", # dconf "cinnamon", # dconf
"mate", # dconf "mate", # dconf
"deepin", # dconf "deepin", # dconf
"xfce4", # xfconf "xfce", # xfconf
"lxde", # pcmanfm "lxde", # pcmanfm
"kde", # qdbus "kde", # qdbus
] ]

View 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)