# crossfetch v2 — Multi-theme + Liturgical Year Design **Date:** 2026-08-12 **Status:** Approved (pending written-spec review) ## Overview Extend the existing `crossfetch` / `ricefx` rice tools (in `~/.local/bin`) with: 1. Multiple base terminal themes (rose-pine, tokyo-night, gruvbox, catppuccin-mocha, nord, dracula). 2. A Western (Gregorian) liturgical-calendar engine: every day belongs to a season that drives default colors; major feast days get a special emblem, verse, and a one-time fullscreen animation (analogous to hyfetch's pride-month easter egg). 3. A fastfetch config generator so `config.jsonc` colors follow the active theme. No fork of hyfetch. The hyfetch repo (`~/git/hyfetch`) is untouched; it served only as the reference for the "seasonal easter egg" pattern (`hyfetch/pride_month.py`, `main.py:532-542`, one-shot-per-year state flag). ## Goals - Theme switch via one env var; all animation/logo/fetch output follows. - Liturgical season colors applied automatically, year-round, no manual steps. - Feast-day emblems + one-shot animations, shown once per feast per year. - fastfetch panel (keys/title/bars) matches the active theme, not hardcoded Rose Pine. ## Non-goals - Orthodox (Julian) computus — Western Gregorian only (user decision). - Forking/renaming hyfetch. - Changing which fastfetch modules are displayed (layout stays as-is). ## Components ### 1. `ricefx.py` — theme table - `ACCENTS` grows from `{dawn, dark}` to named themes: `rose-pine` (= current `dark`), `rose-pine-dawn` (= current `dawn`), `tokyo-night`, `gruvbox`, `catppuccin-mocha`, `nord`, `dracula`. - Every theme maps the **same accent role names** (`love gold rose pine foam iris text subtle muted`) to that theme's official palette hexes, plus a `background()` value per theme. Role names are the API — crossfetch, burst, shimmer, sweep all keep working untouched. - `theme()` resolution order: `$RICEFX_THEME` env (existing var) → existing auto light/dark detection (maps to `rose-pine-dawn` / `rose-pine`). Unknown name → fall back to `rose-pine`, warn once on stderr. - Backward compat: `dawn`/`dark` remain as aliases. ### 2. `liturgy.py` — calendar engine (new, `~/.local/bin`, importable like ricefx) - `easter(year) -> date` — Gregorian computus (Anonymous/Meeus algorithm). - `season(d: date) -> Season` where `Season = (id, name, color_roles)`: - Advent (4 Sundays before Christmas → Dec 24): purple → `iris` + `subtle` - Christmastide (Dec 25 → Jan 5): white/gold → `gold` + `text` - Epiphanytide / Ordinary I (Jan 6 → Ash Wednesday eve): green → `pine` + `foam` - Lent (Ash Wednesday → eve of Palm Sunday): purple → `iris` + `muted` - Holy Week (Palm Sunday → Holy Saturday): crimson → `love` + `muted` - Eastertide (Easter → Pentecost): white/gold → `gold` + `foam` - Ordinary II (day after Pentecost → Advent eve): green → `pine` + `foam` Pentecost itself is a feast (red `love` + `gold`), not a season — feast colors override season colors for the day. Liturgical colors are expressed as **accent role pairs**, resolved through the active theme at render time — so purple is Rose Pine iris on rose-pine, Tokyo Night purple on tokyo-night, etc. - `feast(d: date) -> Feast | None`: Christmas (Dec 25), Epiphany (Jan 6), Ash Wednesday, Palm Sunday, Good Friday, Easter, Ascension (Easter+39), Pentecost (Easter+49), All Saints (Nov 1). `Feast = (id, name, emblem, verse, color_roles)`. - Pure functions, no I/O — fully unit-testable. ### 3. crossfetch integration - **Season colors:** when `$CROSS_BURST` is unset, the burst accent pair comes from `liturgy.season(today).color_roles` instead of the static `gold,iris` default. Static `--logo` gradient and `--fetch` glow tint likewise blend season roles into the poster ramp. Explicit `$CROSS_BURST` always wins. - **Feast one-shot:** on interactive startup (the zshrc splash path), if today is a feast and `shown.json` lacks `{year: feast_id}`, run the fullscreen burst with the feast's emblem, colors, and verse (overrides `daily_verse()`), then record it in `~/.local/state/crossfetch/shown.json`. Subsequent launches that day render the normal splash but keep feast colors + emblem. `$CROSS_FEAST=off` disables; `crossfetch --feast [id]` replays on demand. - **New emblems** (mask format, same `#`-grid as existing 6): `star` (Star of Bethlehem — Christmas, Epiphany), `dove` (Pentecost), `thorns` (crown of thorns — Good Friday). Other feasts reuse existing symbols (Easter → `chi`, Palm Sunday → `jerusalem`, All Saints → `orthodox`, Ash Wednesday → `cross`, Ascension → `chi`). ### 4. fastfetch config generator - Source of truth moves to `~/.config/crossfetch/fastfetch.template.jsonc` — the current `config.jsonc` with every hardcoded `38;2;R;G;B` fragment replaced by `{{role}}` placeholders (e.g. `{{gold}}`, `{{text}}`, `{{subtle}}`). - `crossfetch --sync-fastfetch` renders template → `~/.config/fastfetch/config.jsonc` using the active theme's roles. Comments survive because it is plain string substitution, not JSON re-serialization. - Contrast guard: generator reuses ricefx's legibility check; a role below the readable-contrast threshold on the theme background is swapped for its legible fallback (same rule that keeps pine off dark backgrounds today). ### 5. zshrc startup block - Existing splash invocation unchanged. - Staleness check: if `cross.txt` mtime date ≠ today **or** stored theme marker ≠ `$RICEFX_THEME`, run `crossfetch --logo > cross.txt` and `crossfetch --sync-fastfetch`. Marker file: `~/.local/state/crossfetch/last-render` (date + theme name). ## Error handling - Unknown `$RICEFX_THEME` → rose-pine + single stderr warning. - Missing/corrupt `shown.json` → recreate empty; never crash the shell splash. - `--sync-fastfetch` with missing template → print instructive error, leave existing `config.jsonc` untouched (never write a partial file; write temp + rename). - `NO_COLOR` behavior unchanged (skips animation, `--logo` stays colored). ## Testing - pytest module `test_liturgy.py` (runnable from `~/.local/bin`): - `easter()` vs known dates 2024–2030 (e.g. 2024-03-31, 2025-04-20, 2026-04-05, 2027-03-28, 2028-04-16, 2029-04-01, 2030-04-21). - Season boundaries: Advent start Sundays, Dec 24/25 flip, Ash Wednesday, Easter/Pentecost edges, Ordinary resumption. - `feast()` hits and misses. - Theme table sanity test: every theme defines every role + background. - Visual smoke (manual): `RICEFX_THEME=x crossfetch --logo` for each theme; `crossfetch --feast easter` replay. ## Rollout 1. ricefx themes → 2. liturgy.py + tests → 3. crossfetch season/feast wiring + new emblems → 4. template + `--sync-fastfetch` → 5. zshrc staleness block. Each step leaves the current setup working (season wiring only activates when `$CROSS_BURST` unset; template generated from the existing config).