From 47f59cd43b7ca802df116fd10b970de1fadc6b49 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 18 Feb 2024 09:16:53 +0100 Subject: [PATCH] Fixing sequencing in post command This fixes issue #31 --- waypaper/changer.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/waypaper/changer.py b/waypaper/changer.py index 3648102..bb43414 100644 --- a/waypaper/changer.py +++ b/waypaper/changer.py @@ -17,14 +17,14 @@ def change_wallpaper(image_path, cf, monitor, txt): subprocess.Popen(["killall", "swaybg"]) time.sleep(0.005) except Exception as e: - print(f"{ERR_KILL} {e}") + print(f"{txt.err_kill} {e}") command = ["swaybg"] # if monitor != "All": # command.extend(["-o", monitor]) command.extend(["-i", image_path]) command.extend(["-m", fill, "-c", cf.color]) - subprocess.Popen(command) - print(f"{txt.msg_setwith} {cf.backend}") + # subprocess.Popen(command) + # print(f"{txt.msg_setwith} {cf.backend}") # swww backend: elif cf.backend == "swww": @@ -41,7 +41,7 @@ def change_wallpaper(image_path, cf, monitor, txt): subprocess.Popen(["killall", "swaybg"]) time.sleep(0.005) except Exception as e: - print(f"{ERR_KILL} {e}") + print(f"{txt.err_kill} {e}") subprocess.Popen(["swww", "init"]) command = ["swww", "img", image_path] command.extend(["--resize", fill]) @@ -93,8 +93,8 @@ def change_wallpaper(image_path, cf, monitor, txt): for index, word in enumerate(command): if word == "$wallpaper": command[index] = image_path - subprocess.Popen(command) - print(f'{" ".join(command)} executed') + subprocess.Popen(f'{" ".join(command)}', shell=True).wait() + print(f'Post command {" ".join(command)} executed') except Exception as e: print(f"{txt.err_wall} {e}")