docs(overrides): user guide for auto day/night theme (#79)
All checks were successful
Check / eval (push) Successful in 3m51s

Add an "Auto theme (day/night)" subsection to docs/OVERRIDES.md § 1
(Appearance), after the Icon pack section. Covers what it does (light/dark
switch on a schedule, same one engine), how to turn it on (Look & Feel ›
Auto theme, or the shell set/auto sequence), the settings.autoTheme
fields, and behavior (periodic ~15-min re-check, idempotent rebuilds,
instant disable). Names/fields/flags verified against rofi.nix,
nomarchy-theme-sync.py, and the icon section's style.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-10 22:27:11 +01:00
parent 49e0061dbb
commit 808990592d

View File

@@ -47,6 +47,35 @@ switches (presets don't carry an icon field). To add a pack that isn't listed,
append a row to `iconPacks` in `modules/home/theme.nix`. Set `icons` to `""`
any time to drop back to Papirus with automatic Dark/Light.
### Auto theme (day/night)
Switch automatically between a light **day** theme and a dark **night** theme
on a schedule — the same one engine as a manual `apply`, no second pipeline.
Turn it on from **Look & Feel Auto theme** (`SUPER+M`): toggle it, pick the
day and night themes, and set the sunrise/sunset times. The same from a shell:
```sh
nomarchy-theme-sync set settings.autoTheme.day summer-day --no-switch
nomarchy-theme-sync set settings.autoTheme.night summer-night --no-switch
nomarchy-theme-sync set settings.autoTheme.sunset 20:00 --no-switch
nomarchy-theme-sync set settings.autoTheme.enable true --no-switch
nomarchy-theme-sync auto --force # one rebuild: installs the timer + applies now
```
State lives in `settings.autoTheme`:
| Field | Meaning |
|---|---|
| `enable` | on / off |
| `day` / `night` | theme slugs — e.g. `summer-day` / `summer-night` (see `nomarchy-theme-sync list`) |
| `sunrise` / `sunset` | switch times, `"HH:MM"` (24-hour) |
A timer re-checks every ~15 minutes: the day theme applies around sunrise, the
night theme around sunset — but it only rebuilds when the active theme
actually needs to change, so most checks do nothing. Enabling rebuilds once
(to install the timer); disabling is instant. Preview the current decision
without switching with `nomarchy-theme-sync auto --which`.
These values are deliberately kept at normal priority in the modules, so they
stay owned by the theme system. If you *insist* on pinning one in `home.nix`
regardless of the active theme, use `lib.mkForce` (see §4) — but then the CLI