Merge pull request #86 from CalfMoon/main

Improve multi-monitor support
This commit is contained in:
Roman 2024-10-19 10:14:50 +09:00 committed by GitHub
commit 70473ee152
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 8 deletions

View File

@ -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:

View File

@ -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}")