feat(wallpaper_changer): wallpaper builder distinguish between left/right in image name

center images with left in their name from their left corner
center images with right in their name from their center
This commit is contained in:
Lucas Vivo committed 2026-11-13 18:15:19 +01:00
1 parent 7609177e35
commit 03d913f251
2 files changed
+9 -3

No files matched your search

+2 -2
View File
@@ -125,11 +125,11 @@ def main() -> None:
wallpaper_builder = WallpaperBuilder()
wallpaper_setter = WallpaperSetter()
for _ in range(args.times):
wallpaper_path = wallpaper_builder.build(
wallpaper_path,_ = wallpaper_builder.build(
imgs,
monitors,
private_key=cfg.private_key,
conf_dir=cfg.conf_dir,
wallpaper_dir=cfg.wallpaper_dir,
search_terms=args.search,
exclude=args.exclude,
decode_and_leave=args.decode_and_leave,
@@ -73,11 +73,17 @@ class WallpaperBuilder:
logger.debug(f"Leaving decrypted image on disk: {image_record['file']}")
centering_panorama = [(0,0),(1,0)]
if "Left" in str(image_record["name"]):
centering = (0,0)
elif "Right" in str(image_record["name"]):
centering = (1,0)
else:
centering = centering_panorama[random.randint(0,1)]
fitted = ImageOps.fit(
source,
(monitor.width, monitor.height),
method=Image.Resampling.LANCZOS,
centering = centering_panorama[random.randint(0,1)]
centering = centering
)
monitor_left = monitor.x - left