Kill hyprpaper deamon on swww

Kill the hyprpaper deamon if we switched to swww to avoid the conflict. Discussed in #7
This commit is contained in:
Roman 2024-05-24 17:18:21 +09:00
parent b066d4e162
commit 839dd839e2

View File

@ -34,12 +34,15 @@ def change_wallpaper(image_path, cf, monitor, txt):
"tile": "no",
}
fill = fill_types[cf.fill_option.lower()]
if "swaybg" in cf.installed_backends:
try:
try:
if "swaybg" in cf.installed_backends:
subprocess.Popen(["killall", "swaybg"])
time.sleep(0.005)
except Exception as e:
print(f"{txt.err_kill} {e}")
if "hyprpaper" in cf.installed_backends:
subprocess.Popen(["killall", "hyprpaper"])
time.sleep(0.005)
except Exception as e:
print(f"{txt.err_kill} {e}")
subprocess.Popen(["swww-daemon"])
command = ["swww", "img", image_path]
command.extend(["--resize", fill])