mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-05-21 08:41:00 +02:00
wallpaper: Move function around.
This commit is contained in:
parent
5ab39a2553
commit
20adf692a0
@ -31,6 +31,28 @@ def xfconf(path, img):
|
||||
"--property", path, "--set", 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_desktop_wallpaper(desktop, img):
|
||||
"""Set the wallpaper for the desktop environment."""
|
||||
desktop = str(desktop).lower()
|
||||
@ -58,28 +80,6 @@ def set_desktop_wallpaper(desktop, img):
|
||||
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):
|
||||
"""Set the wallpaper."""
|
||||
desktop = get_desktop_env()
|
||||
|
Loading…
Reference in New Issue
Block a user