From de674d772e6e8d4534de7d8469cf3ed77dab61c8 Mon Sep 17 00:00:00 2001 From: "Kritagya Bhattarai (CalfMoon)" Date: Fri, 18 Oct 2024 15:19:36 +0545 Subject: [PATCH 1/2] feat: enable multi-monitor for swaybg and mpvpaper --- waypaper/changer.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/waypaper/changer.py b/waypaper/changer.py index 78fdfa8..473f222 100644 --- a/waypaper/changer.py +++ b/waypaper/changer.py @@ -25,8 +25,8 @@ def change_wallpaper(image_path: Path, cf: Config, monitor: str, txt: Chinese|En fill = cf.fill_option.lower() command = ["swaybg"] - # if monitor != "All": - # command.extend(["-o", monitor]) + if monitor != "All": + command.extend(["-o", monitor]) command.extend(["-i", str(image_path)]) command.extend(["-m", fill, "-c", cf.color]) subprocess.Popen(command) @@ -54,11 +54,10 @@ def change_wallpaper(image_path: Path, cf: Config, monitor: str, txt: Chinese|En command = ["mpvpaper"] command.extend(["-o", f"no-audio loop {fill} --background-color='{cf.color}'"]) - # if monitor != "All": - # command.extend([monitor]) - # else: - # command.extend('*') - command.extend('*') + if monitor != "All": + command.extend([monitor]) + else: + command.extend('*') command.extend([image_path]) subprocess.Popen(command) print(f"{txt.msg_setwith} {cf.backend}") From accd312f3706a7cc67380a697bed2c52d969700e Mon Sep 17 00:00:00 2001 From: "Kritagya Bhattarai (CalfMoon)" Date: Fri, 18 Oct 2024 16:45:25 +0545 Subject: [PATCH 2/2] feat: add condition to monitor display option --- waypaper/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/waypaper/app.py b/waypaper/app.py index 33fd93a..7f9f912 100644 --- a/waypaper/app.py +++ b/waypaper/app.py @@ -237,10 +237,12 @@ class App(Gtk.Window): def monitor_option_display(self) -> None: - """Display monitor option if backend is swww or hyprpaper (with swww installed)""" + """Display monitor option if backend is not feh or wallutils""" self.options_box.remove(self.monitor_option_combo) # Check available monitors: monitor_names = ["All"] + if self.cf.backend in ["feh", "wallutils", "none"]: + return monitor_names.extend(get_monitor_names()) # Create a monitor option dropdown menu: