Give the desktop real themes, video wallpapers, and honest titlebars
Appearance now opens on Themes: light and dark side by side, each remembering its own choice, over galleries of ten shipped themes — Tokyo Moon and Day joined by Moon Rose, Catppuccin, Nord, Gruvbox and Everforest in both modes. A theme is a complete palette: the catalog lives in themes.json, Theme.qml reads every color token from the active record, and one render pipeline carries it to kitty, tmux, btop, GTK, Vicinae, Firefox's chrome, and the lock screen. The Theme editor builds new ones from four wells — wheel, hex, or eyedropper — with derived surfaces, a saturation slider, debounced fine-tune, and effects that save with the theme. Custom edits finally keep GNOME's accent, kitty's border, and hyprlock in sync. Wallpapers can be video: mpvpaper per output, hardware-decoded, muted and looped, supervised and respawned. Panama owns the pausing — games, battery, and a bar pill for right now — because the compositor rebuilds full-screen blur for every frame a video wallpaper draws. The lock screen gets a still frame. Titlebars stop lying. GNOME apps get close-only on your chosen side, the maximize and double-click settings are gone, the Settings window obeys the same rules, and its titlebar can be turned off entirely. Typography becomes five labeled dropdowns instead of a wall of samples. Contracts updated and written throughout (165 now); per the redesign workflow none were executed — the full sweep runs once at the end. Claude-Session: https://claude.ai/code/session_01Ms2FbjQy31TVf3CEvQhGM8
This commit is contained in:
@@ -89,6 +89,79 @@ done
|
||||
looks_accents="$(grep -cE '^\s+(orchid|teal|green|amber|orange|rose|slate)\s*=' "$looks" || true)"
|
||||
(( looks_accents == 0 )) || note "looks.lua has an accent table again ($looks_accents entries)"
|
||||
|
||||
# ── The same argument, one level up: the THEME resolver ──────────────────────
|
||||
#
|
||||
# An accent is one colour. A theme is the whole palette, and the two shell
|
||||
# generators both need the active one -- panama-theme-apps to render kitty,
|
||||
# GTK, btop, tmux, Vicinae and Firefox, panama-lock to render the lock screen.
|
||||
# They answered that question with their own tables of Tokyo Night literals
|
||||
# until the resolution moved into panama-palette beside accent_hex, for exactly
|
||||
# the reason recorded above. link-dotfiles is the third caller: it seeds the
|
||||
# lock screen at install time.
|
||||
|
||||
themes="$repo_dir/config/dot/quickshell/config/themes.json"
|
||||
linker="$repo_dir/setup/scripts/link-dotfiles"
|
||||
|
||||
grep -q 'themes.json' "$helper" || note 'the shell palette helper does not read themes.json, so nothing shared resolves a theme'
|
||||
for consumer in "$theme_apps" "$lock"; do
|
||||
grep -q 'resolve_theme' "$consumer" \
|
||||
|| note "$(basename "$consumer") does not resolve the active theme through the shared function"
|
||||
done
|
||||
grep -q 'render_hyprlock' "$linker" \
|
||||
|| note 'link-dotfiles seeds the lock screen without the shared renderer, so it carries its own colour table again'
|
||||
|
||||
# ── The resolver answers with a complete theme ───────────────────────────────
|
||||
|
||||
if [[ -r "$themes" ]] && jq -e . "$themes" >/dev/null 2>&1; then
|
||||
resolver_fixture="$(mktemp -d /tmp/panama-theme-resolve.XXXXXX)"
|
||||
trap 'rm -rf "$resolver_fixture"' EXIT
|
||||
mkdir -p "$resolver_fixture/panama"
|
||||
|
||||
while read -r id; do
|
||||
scheme="$(jq -r --arg id "$id" '.themes[] | select(.id == $id) | .scheme' "$themes")"
|
||||
jq -n --arg id "$id" '{themeProfileId: $id}' >"$resolver_fixture/panama/settings.json"
|
||||
resolved="$(XDG_CONFIG_HOME="$resolver_fixture" \
|
||||
bash -c "source '$helper'; resolve_theme '$scheme'")"
|
||||
|
||||
[[ "$(jq -r '.id' <<<"$resolved")" == "$id" ]] \
|
||||
|| note "the resolver does not find the shipped theme '$id'"
|
||||
# 19 palette tokens and 16 ansi keys, or a generator writes a config
|
||||
# with a colour of "" in it.
|
||||
[[ "$(jq -r '.palette | length' <<<"$resolved")" == "19" ]] \
|
||||
|| note "'$id' resolves with $(jq -r '.palette | length' <<<"$resolved") palette keys rather than 19"
|
||||
[[ "$(jq -r '.ansi | length' <<<"$resolved")" == "16" ]] \
|
||||
|| note "'$id' resolves with $(jq -r '.ansi | length' <<<"$resolved") ansi keys rather than 16"
|
||||
done < <(jq -r '.themes[].id' "$themes")
|
||||
|
||||
# A custom carrying only an accent -- which is every profile saved before
|
||||
# themes existed. It must keep its accent AND inherit a full palette.
|
||||
jq -n '{themeProfileId: "bare",
|
||||
themeProfiles: [{id: "bare", name: "Bare", scheme: "dark",
|
||||
accent: "#ff0088", secondary: "#00ffcc"}]}' \
|
||||
>"$resolver_fixture/panama/settings.json"
|
||||
bare="$(XDG_CONFIG_HOME="$resolver_fixture" bash -c "source '$helper'; resolve_theme dark")"
|
||||
[[ "$(jq -r '.accent' <<<"$bare")" == "#ff0088" ]] \
|
||||
|| note 'a custom theme without a palette loses its own accent'
|
||||
default_bg="$(jq -r --arg id "$(jq -r '.defaultDark' "$themes")" \
|
||||
'.themes[] | select(.id == $id) | .palette.bg' "$themes")"
|
||||
[[ "$(jq -r '.palette.bg' <<<"$bare")" == "$default_bg" ]] \
|
||||
|| note 'a custom theme without a palette does not inherit the scheme default, so every profile saved before themes existed resolves to no colours at all'
|
||||
|
||||
# An unknown id must land on the scheme default rather than on an empty
|
||||
# record: a settings file naming a deleted theme is a normal state.
|
||||
jq -n '{themeProfileId: "no-such-theme"}' >"$resolver_fixture/panama/settings.json"
|
||||
unknown="$(XDG_CONFIG_HOME="$resolver_fixture" bash -c "source '$helper'; resolve_theme light")"
|
||||
[[ "$(jq -r '.id' <<<"$unknown")" == "$(jq -r '.defaultLight' "$themes")" ]] \
|
||||
|| note "an unknown theme id resolves to '$(jq -r '.id' <<<"$unknown")' rather than to the light default"
|
||||
|
||||
# The per-mode keys are the selection; themeProfileId is the fallback.
|
||||
jq -n --arg dark "$(jq -r '[.themes[] | select(.scheme == "dark")][-1].id' "$themes")" \
|
||||
'{themeProfileId: "day", themeDark: $dark}' >"$resolver_fixture/panama/settings.json"
|
||||
per_mode="$(XDG_CONFIG_HOME="$resolver_fixture" bash -c "source '$helper'; resolve_theme dark")"
|
||||
[[ "$(jq -r '.id' <<<"$per_mode")" == "$(jq -r '[.themes[] | select(.scheme == "dark")][-1].id' "$themes")" ]] \
|
||||
|| note 'themeDark does not win over themeProfileId, so a scheme flip lands on the wrong theme'
|
||||
fi
|
||||
|
||||
# ── The helper resolves what the palette says ────────────────────────────────
|
||||
|
||||
while read -r name; do
|
||||
|
||||
Reference in New Issue
Block a user