diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-06-30 23:09:06 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-06-30 23:09:06 +1000 |
| commit | 20adf692a019da1be01c203764bf287830c93395 (patch) | |
| tree | 13351bbda4c5b493a2db12f6d2147b9ed5f767bc | |
| parent | 5ab39a25535c8d17cdbd418cdfbc1296c9868610 (diff) | |
wallpaper: Move function around.
| -rwxr-xr-x | pywal/wallpaper.py | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py index ded1109..48d4249 100755 --- a/pywal/wallpaper.py +++ b/pywal/wallpaper.py @@ -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() |
