diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-16 08:37:28 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-16 08:37:28 +0200 |
| commit | b970a0deaad3a6723fe5727a3db7b653ebb3e7a3 (patch) | |
| tree | 2b85acb01b9c265f657546690addeeb389a229fd /bin/udt-accent | |
| parent | 593b8a65eda7ba9f7c7341ef5c1584b92bfda9c4 (diff) | |
| download | unified-desktop-theme-b970a0deaad3a6723fe5727a3db7b653ebb3e7a3.tar.gz unified-desktop-theme-b970a0deaad3a6723fe5727a3db7b653ebb3e7a3.zip | |
refactor(cache): move the generated files to ~/.cache/udt
They lived in ~/.cache/wal because pywal owned that directory and udt-accent
was written alongside a pywal run. Nothing on this desktop invokes pywal any
more: the wal binary is unused, and udt-accent imports pywal.backends.colorz
as a quantisation library, which writes nothing. Sharing the cache only left
the ownership ambiguous.
colors.json is the one file that cannot move. pywalfox hardcodes
<cache>/wal/colors.json and honours only XDG_CACHE_HOME, which would relocate
every cache on the system, so udt-accent writes the real file to ~/.cache/udt
and install.sh symlinks the old path at it. ~/.cache/wal now holds that link
and nothing else.
Consumers repointed here: install.sh, udt-accent, launcher.rasi's @WPAPER@.
Outside the repo, wallp, Hyprland's look_and_feel.lua and quickshell's
shared/Theme.qml move with it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'bin/udt-accent')
| -rwxr-xr-x | bin/udt-accent | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bin/udt-accent b/bin/udt-accent index 3cb9438..391664b 100755 --- a/bin/udt-accent +++ b/bin/udt-accent @@ -9,6 +9,7 @@ Usage: udt-accent <wallpaper-path> The extraction deliberately calls pywal's colorz backend directly rather than running `wal -i`, because `wal -i` rewrites the whole ~/.cache/wal directory +(which this no longer writes to, but pywal still would) including the terminal's ANSI colors. See the design spec for why that matters. """ @@ -29,17 +30,22 @@ from udt_colors import ACCENTS, FALLBACK, PALETTE, SCHEME # noqa: E402 MIN_CHROMA = 10.0 -OUTPUT = Path.home() / ".cache" / "wal" / "udt-accent.rasi" -BORDER_OUTPUT = Path.home() / ".cache" / "wal" / "udt-border.lua" +CACHE = Path.home() / ".cache" / "udt" +OUTPUT = CACHE / "udt-accent.rasi" +BORDER_OUTPUT = CACHE / "udt-border.lua" SUBLIME = (Path.home() / ".config" / "sublime-text" / "Packages" / "User" / "udt.sublime-color-scheme") -QML_OUTPUT = Path.home() / ".cache" / "wal" / "udt-palette.qml" +QML_OUTPUT = CACHE / "udt-palette.qml" # The installed rofi palette, itself generated by udt-palette. Read rather than # duplicated so the QML singleton carries exactly the colours rofi uses, under # the same names. PALETTE_RASI = Path.home() / ".config" / "rofi" / "udt" / "palette.rasi" -COLORS_JSON = Path.home() / ".cache" / "wal" / "colors.json" +# pywalfox hardcodes <cache>/wal/colors.json and honours only XDG_CACHE_HOME, +# which would move every cache, so this one file is written where it looks. +# install.sh symlinks ~/.cache/wal/colors.json here, so the real file lives +# with the rest of the palette and ~/.cache/wal holds nothing but that link. +COLORS_JSON = CACHE / "colors.json" def write_atomic(path, content): @@ -238,7 +244,7 @@ def write_colors_json(name, image): doc = { # Resolved, not as passed: wallp gives the real file but a caller may - # give ~/.cache/wal/wpaper, the symlink to it. Same wallpaper either + # give ~/.cache/udt/wpaper, the symlink to it. Same wallpaper either # way, so record one spelling. "wallpaper": os.path.realpath(image), "alpha": "100", |
