Skip to content

Commit

Permalink
Fix for killall bug on NixOS
Browse files Browse the repository at this point in the history
  • Loading branch information
anufrievroman committed Sep 24, 2023
1 parent 708201e commit ef598e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion waypaper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from waypaper.arguments import args


__version__ = "1.9.1"
__version__ = "1.9.2"


def run():
Expand Down
14 changes: 10 additions & 4 deletions waypaper/changer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor):
# swaybg backend:
if backend == "swaybg":
fill = fill_option.lower()
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
try:
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
except Exception as e:
print(e)
command = ["swaybg"]
# if monitor != "All":
# command.extend(["-o", monitor])
Expand All @@ -33,8 +36,11 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor):
"tile": "no",
}
fill = fill_types[fill_option.lower()]
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
try:
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
except Exception as e:
print(e)
subprocess.Popen(["swww", "init"])
command = ["swww", "img", image_path]
command.extend(["--resize", fill])
Expand Down

0 comments on commit ef598e0

Please sign in to comment.