wallpaper: Add support for sway

This commit is contained in:
dylan araps 2017-12-17 14:33:58 +11:00
parent 245c7fe9b2
commit 477850b45b

View File

@ -27,6 +27,10 @@ def get_desktop_env():
if desktop:
return "MATE"
desktop = os.environ.get("SWAYSOCK")
if desktop:
return "SWAY"
def xfconf(path, img):
"""Call xfconf to set the wallpaper on XFCE."""
@ -79,6 +83,9 @@ def set_desktop_wallpaper(desktop, img):
util.disown(["gsettings", "set", "org.mate.background",
"picture-filename", img])
elif "sway" in desktop:
util.disown(["swaymsg", "output", "*", "bg", img, "fill"])
else:
set_wm_wallpaper(img)