mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-29 22:18:49 +02:00
wallpaper: Fix bug with wallpaper not being set. Closes #21
This commit is contained in:
parent
15684c5b10
commit
ba29542a2a
@ -54,6 +54,31 @@ def set_desktop_wallpaper(desktop, img):
|
|||||||
subprocess.Popen(["gsettings", "set", "org.mate.background",
|
subprocess.Popen(["gsettings", "set", "org.mate.background",
|
||||||
"picture-filename", img])
|
"picture-filename", img])
|
||||||
|
|
||||||
|
else:
|
||||||
|
set_wm_wallpaper(img)
|
||||||
|
|
||||||
|
|
||||||
|
def set_wm_wallpaper(img):
|
||||||
|
"""Set the wallpaper for window manager environments."""
|
||||||
|
if shutil.which("feh"):
|
||||||
|
subprocess.Popen(["feh", "--bg-fill", img])
|
||||||
|
|
||||||
|
elif shutil.which("nitrogen"):
|
||||||
|
subprocess.Popen(["nitrogen", "--set-zoom-fill", img])
|
||||||
|
|
||||||
|
elif shutil.which("bgs"):
|
||||||
|
subprocess.Popen(["bgs", img])
|
||||||
|
|
||||||
|
elif shutil.which("hsetroot"):
|
||||||
|
subprocess.Popen(["hsetroot", "-fill", img])
|
||||||
|
|
||||||
|
elif shutil.which("habak"):
|
||||||
|
subprocess.Popen(["habak", "-mS", img])
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("error: No wallpaper setter found.")
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def set_wallpaper(img):
|
def set_wallpaper(img):
|
||||||
"""Set the wallpaper."""
|
"""Set the wallpaper."""
|
||||||
@ -63,24 +88,7 @@ def set_wallpaper(img):
|
|||||||
set_desktop_wallpaper(desktop, img)
|
set_desktop_wallpaper(desktop, img)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if shutil.which("feh"):
|
set_wm_wallpaper(img)
|
||||||
subprocess.Popen(["feh", "--bg-fill", img])
|
|
||||||
|
|
||||||
elif shutil.which("nitrogen"):
|
|
||||||
subprocess.Popen(["nitrogen", "--set-zoom-fill", img])
|
|
||||||
|
|
||||||
elif shutil.which("bgs"):
|
|
||||||
subprocess.Popen(["bgs", img])
|
|
||||||
|
|
||||||
elif shutil.which("hsetroot"):
|
|
||||||
subprocess.Popen(["hsetroot", "-fill", img])
|
|
||||||
|
|
||||||
elif shutil.which("habak"):
|
|
||||||
subprocess.Popen(["habak", "-mS", img])
|
|
||||||
|
|
||||||
else:
|
|
||||||
print("error: No wallpaper setter found.")
|
|
||||||
return
|
|
||||||
|
|
||||||
print("wallpaper: Set the new wallpaper")
|
print("wallpaper: Set the new wallpaper")
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user