wallpaper: Fix bug with wallpaper not being set. Closes
@@ -54,15 +54,12 @@ def set_desktop_wallpaper(desktop, img):
subprocess.Popen(["gsettings", "set", "org.mate.background",
"picture-filename", img])
+ else:
+ set_wm_wallpaper(img)
-def set_wallpaper(img):
- """Set the wallpaper."""
- desktop = get_desktop_env()
- if desktop:
- set_desktop_wallpaper(desktop, img)
-
- else:
+def set_wm_wallpaper(img):
+ """Set the wallpaper for window manager environments."""
if shutil.which("feh"):
subprocess.Popen(["feh", "--bg-fill", img])
@@ -82,5 +79,16 @@ def set_wallpaper(img):
print("error: No wallpaper setter found.")
return
+
+def set_wallpaper(img):
+ """Set the wallpaper."""
+ desktop = get_desktop_env()
+
+ if desktop:
+ set_desktop_wallpaper(desktop, img)
+
+ else:
+ set_wm_wallpaper(img)
+
print("wallpaper: Set the new wallpaper")
return 0
