From 839dd839e22687f8370a03c85b76581af96da0c7 Mon Sep 17 00:00:00 2001 From: Roman Date: Fri, 24 May 2024 17:18:21 +0900 Subject: [PATCH] Kill hyprpaper deamon on swww Kill the hyprpaper deamon if we switched to swww to avoid the conflict. Discussed in #7 --- waypaper/changer.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/waypaper/changer.py b/waypaper/changer.py index 63c23e0..a40a44d 100644 --- a/waypaper/changer.py +++ b/waypaper/changer.py @@ -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])