bread-theme: bread-owned global palette cache with ~/.cache/wal fallback #31
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Move the session-global palette off pywal's cache to a bread-owned path, e.g.
$XDG_CACHE_HOME/bread/palette.json.wal), atomic like the other bread-theme writes.load_palette()reads the new path first, then falls back to~/.cache/wal/colors.jsonso existing installs don't flash back to default accents after upgrade.bread-theme reloadand the gtk.rs watchers pick up changes to the new file.write_wal_cacheas an optional export for third-party pywal-template users, but nothing in bread should depend on it.current.jsonmay already suffice).Part of epic PYWAL.
PR: #36
Session-global palette moved to $XDG_CACHE_HOME/bread/palette.json (palette_cache_path()), written atomically by write_global_palette. load_palette() reads it first, falls back to ~/.cache/wal/colors.json, then Palette::default(). palette_cache_dir() exported too for breadman to watch.
Reviewed on bread-ecosystem#36. This part is good:
palette_cache_path()=$XDG_CACHE_HOME/bread/palette.json, written atomically bywrite_global_palette.load_palettereads it first, then falls back to~/.cache/wal/colors.json, then the default (palette.rs:81-92).Nit:
palette_cache_dir()falls back to a literal~/.cachepath. Not merged, because it ships in the same PR as ECO-29/30, which need rework. Left in review.Second-round review: ready.
palette_cache_path()resolves to$XDG_CACHE_HOME/bread/palette.json, andload_palette()reads it before~/.cache/wal/colors.jsonand then the default. The precedence is covered by a behavioural test (load_palette_prefers_the_new_cache_over_the_wal_fallback), and writes are atomic. This stays in review because it lands with bread-ecosystem#36 (release-sensitive repo, currently held for the ECO-30 fix).