diff --git a/assets/wallpapers/topography-dark.jpg b/assets/wallpapers/topography-dark.jpg deleted file mode 100644 index 9f24489..0000000 Binary files a/assets/wallpapers/topography-dark.jpg and /dev/null differ diff --git a/assets/wallpapers/topography-dark.png b/assets/wallpapers/topography-dark.png new file mode 100644 index 0000000..8da49a8 Binary files /dev/null and b/assets/wallpapers/topography-dark.png differ diff --git a/assets/wallpapers/topography-light.jpg b/assets/wallpapers/topography-light.jpg deleted file mode 100644 index ba106b4..0000000 Binary files a/assets/wallpapers/topography-light.jpg and /dev/null differ diff --git a/assets/wallpapers/topography-light.png b/assets/wallpapers/topography-light.png new file mode 100644 index 0000000..cfb04c5 Binary files /dev/null and b/assets/wallpapers/topography-light.png differ diff --git a/lib/theme.nix b/lib/theme.nix index cb452ec..aae0e9c 100644 --- a/lib/theme.nix +++ b/lib/theme.nix @@ -62,11 +62,11 @@ let }; wallpapers = { dir = "${config.home.homeDirectory}/Pictures/Screensavers"; - dark = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper-dark.jpg"; - light = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper-light.jpg"; - current = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper.jpg"; - staticDark = ../assets/wallpapers/topography-dark.jpg; - staticLight = ../assets/wallpapers/topography-light.jpg; + dark = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper-dark.png"; + light = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper-light.png"; + current = "${config.home.homeDirectory}/Pictures/Screensavers/wallpaper.png"; + staticDark = ../assets/wallpapers/topography-dark.png; + staticLight = ../assets/wallpapers/topography-light.png; generation = wallpaperGeneration; }; paths = { diff --git a/scripts/theme.sh b/scripts/theme.sh index c2b6f3f..0429b4c 100644 --- a/scripts/theme.sh +++ b/scripts/theme.sh @@ -23,8 +23,8 @@ set_wallpaper() { # macOS caches wallpaper data by file path - copy to a unique temp path # so macOS is forced to read the new image data wp_dir=$(dirname "$wp_resolved") - wp_tmp="${wp_dir}/.wallpaper-active-$$.jpg" - rm -f "${wp_dir}"/.wallpaper-active-*.jpg 2>/dev/null || true + wp_tmp="${wp_dir}/.wallpaper-active-$$.png" + rm -f "${wp_dir}"/.wallpaper-active-*.png 2>/dev/null || true cp "$wp_resolved" "$wp_tmp" osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"${wp_tmp}\"" >/dev/null 2>&1 || true fi diff --git a/scripts/wallpaper-gen.py b/scripts/wallpaper-gen.py index 3640152..2a90465 100644 --- a/scripts/wallpaper-gen.py +++ b/scripts/wallpaper-gen.py @@ -77,8 +77,8 @@ CONTOUR_LEVELS: int = max(1, int(CONTOURS.get("levels", 20))) # cozybox palette - matches lib/theme.nix THEMES: dict[str, dict[str, Rgb]] = { "dark": { - "bg": (0x18, 0x18, 0x18), - "line": (0x2d, 0x2d, 0x2d), + "bg": (0x00, 0x00, 0x00), + "line": (0x1a, 0x1a, 0x1a), "label": (0xFF, 0xFF, 0xFF), }, "light": { @@ -451,14 +451,16 @@ def gen() -> None: if LABEL_ENABLED and font is not None: draw = ImageDraw.Draw(img) draw.text((LABEL_MARGIN_X, H - LABEL_MARGIN_BOTTOM), label, fill=colors["label"], font=font) - out_path = os.path.join(DIR, f"wallpaper-{theme_name}.jpg") - img.save(out_path, quality=95) + out_path = os.path.join(DIR, f"wallpaper-{theme_name}.png") + if os.path.exists(out_path): + os.remove(out_path) + img.save(out_path) log(f"wrote theme={theme_name} path={out_path}") - link = os.path.join(DIR, "wallpaper.jpg") + link = os.path.join(DIR, "wallpaper.png") if os.path.lexists(link): os.unlink(link) - target = os.path.join(DIR, f"wallpaper-{theme}.jpg") + target = os.path.join(DIR, f"wallpaper-{theme}.png") os.symlink(target, link) log(f"finish status=ok target={target} link={link}")