feat(menu): #79 slice 3 — Look & Feel › Auto theme (completes #79)
All checks were successful
Check / eval (push) Successful in 3m46s

Adds an "Auto theme (on/off)" row to Look & Feel and an `autotheme`
submenu: toggle the feature, pick the day/night themes (from
`nomarchy-theme-sync list`), and set the sunrise/sunset times (HH:MM,
validated). This is the menu surface over settings.autoTheme, completing
the auto time-of-day theme feature (slices: CLI / timer / menu).

Enabling writes the flag and defaults the summer-day/summer-night pair
--no-switch, then runs `auto --force`, so a single rebuild both installs
the timer and applies the correct theme for now. Disabling is instant
(--no-switch): the flag flips and `auto` self-gates, so the lingering
timer no-ops until the next rebuild. Day/night/time writes are live
--no-switch (read by `auto` at tick time).

Verification: V1 — HM generation builds (bash -n on nomarchy-menu at
build) + bash -n on the built menu. Logic test with stubbed
rofi/theme-sync/notify: selecting the toggle from off runs exactly `set
day/night/enable ... --no-switch` then `auto --force` — the intended
one-rebuild path. V0 flake check green. All three #79 slices shipped;
the live timer switch across sunset is a real-session (V3) check on a
Nomarchy machine.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-10 21:53:37 +01:00
parent c44616aeb0
commit 860c70466f
5 changed files with 118 additions and 23 deletions

View File

@@ -286,6 +286,20 @@ Design/decision records and a running log of shipped work (items marked
**Deliberately NOT shipping more packs by default** (Bernardo 2026-07-10):
papirus alone is already ~1 GiB and each extra pack adds ~hundreds of MB,
so variety is opt-in per install, not a default closure cost.
- ✓ **Auto time-of-day theme (#79, `VISION § D`):** an automatic light/dark
theme switch through the **same** engine as a manual apply — no second
pipeline. `settings.autoTheme = {enable, day, night, sunrise, sunset}`
drives `nomarchy-theme-sync auto`, which picks day vs night by the local
clock and applies the preset **only if it differs** (idempotent).
`modules/home/autotheme.nix` installs a user timer
(`OnStartupSec` + `OnCalendar=*:0/15` + `Persistent`, gated on the state
flag) that ticks `auto`; Look & Feel Auto theme toggles it and picks the
pair/times. `cmd_apply`'s core was factored into `apply_named` so `auto`
reuses it verbatim. Periodic (not exact sunrise/sunset timers) for
robustness to suspend/DST; the idempotent `auto` keeps ticks cheap. Enable
rebuilds once (installs the timer + `auto --force`); disable is instant
(the flag flips and `auto` self-gates). Live timer→switch is a real-session
(V3) check.
- **Nicer shell out of the box:** ✓ zsh is the default login shell, with a
starship prompt themed from the JSON, autosuggestions + syntax
highlighting, and modern-CLI ergonomics — `cat`→bat (theme "ansi", so it

View File

@@ -92,7 +92,7 @@ Reference: [HARDWARE.md](HARDWARE.md) §4§5, §10.
| Idea | Intent | Notes |
|------|--------|-------|
| **Fewer themes, sharper** | Finish or quarantine neon-glass; invest in whole-swap quality | Contrast stays gated |
| **Time-of-day pair** | Auto light/dark (e.g. summer-day ↔ summer-night) from schedule | Still one theme engine |
| **Time-of-day pair** | Auto light/dark (e.g. summer-day ↔ summer-night) from schedule | ✓ shipped #79 (2026-07-10) — `settings.autoTheme` + timer; still one engine |
| **Theme switch speed** | Wallpapers artifact split (LATER) if switches still feel slow | GOALS: no second pipeline |
---