Merge pull request #65 from Naragiri/swww-fps-patch

Add support for swww --transition-fps
This commit is contained in:
Roman 2024-07-13 20:11:18 +09:00 committed by GitHub
commit 3817518994
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,7 @@ def change_wallpaper(image_path: str, cf: Config, monitor: str, txt: Chinese|Eng
command.extend(["--transition-step", str(cf.swww_transition_step)])
command.extend(["--transition-angle", str(cf.swww_transition_angle)])
command.extend(["--transition-duration", str(cf.swww_transition_duration)])
command.extend(["--transition-fps", str(cf.swww_transition_fps)])
if monitor != "All":
command.extend(["--outputs", monitor])
subprocess.Popen(command)

View File

@ -29,6 +29,7 @@ class Config:
self.swww_transition_step = 90
self.swww_transition_angle = 0
self.swww_transition_duration = 2
self.swww_transition_fps = 60
self.lang = "en"
self.monitors = [self.selected_monitor]
self.wallpapers = []
@ -72,6 +73,7 @@ class Config:
self.swww_transition_step = config.get("Settings", "swww_transition_step", fallback=self.swww_transition_step)
self.swww_transition_angle = config.get("Settings", "swww_transition_angle", fallback=self.swww_transition_angle)
self.swww_transition_duration = config.get("Settings", "swww_transition_duration", fallback=self.swww_transition_duration)
self.swww_transition_fps = config.get("Settings", "swww_transition_fps", fallback=self.swww_transition_fps)
self.lang = config.get("Settings", "language", fallback=self.lang)
self.include_subfolders = config.getboolean("Settings", "subfolders", fallback=self.include_subfolders)
self.show_hidden = config.getboolean("Settings", "show_hidden", fallback=self.show_hidden)
@ -109,6 +111,8 @@ class Config:
self.swww_transition_step = 90
if 0 > int(self.swww_transition_duration):
self.swww_transition_duration = 2
if 0 > int(self.swww_transition_fps):
self.swww_transition_fps = 60
def attribute_selected_wallpaper(self) -> None:
"""If only certain monitor was affected, change only its wallpaper"""
@ -151,6 +155,7 @@ class Config:
config.set("Settings", "swww_transition_step", str(self.swww_transition_step))
config.set("Settings", "swww_transition_angle", str(self.swww_transition_angle))
config.set("Settings", "swww_transition_duration", str(self.swww_transition_duration))
config.set("Settings", "swww_transition_fps", str(self.swww_transition_fps))
with open(self.config_file, "w") as configfile:
config.write(configfile)