feat(waybar): open a calendar (calcurse) on the clock click
All checks were successful
Check / eval (push) Successful in 2m54s

Item 42, de-scoped by Bernardo to app-only — no account sync (the user
configures that themselves locally). Clicking the Waybar date/clock now
runs nomarchy-calendar → calcurse in a floating, centered ghostty window
tagged --class=com.nomarchy.calendar (+ --gtk-single-instance=false for a
fresh standalone window), matched by a float+size+center windowrule. The
launcher self-gates on calcurse. Dropped the clock's format-alt date
toggle (conflicts with on-click) and moved the long date into the tooltip.
Parity: on-click added to all four whole-swap jsoncs.

Ships calcurse + pwvucontrol uncommented in the downstream template
(opt-out). Enforces ghostty always installed (ghostty.nix: enable = true
unconditional; nomarchy.ghostty.enable now gates only the theming/config)
so the --class launcher can rely on it.

Verified: V0 green; four jsoncs valid JSON; V1 HM built — launcher ships,
generated clock renders on-click=nomarchy-calendar (format-alt gone, date
in tooltip), hyprland has the 3 calendar windowrules, ghostty in the HM
profile. Click→float→calcurse month view is V3 (queued). Sync is
deliberately the user's own config, not a distro feature.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-08 20:19:30 +01:00
parent 2954283e23
commit be8d8a7d9b
11 changed files with 83 additions and 56 deletions

View File

@@ -252,55 +252,6 @@ Next slice: on hardware, run `hyprctl clients` while each is open, read
the real `class`, then append rules. Also revisit whether blueman/s-c-p
actually float once seen (regex tolerance for the `.…-wrapped` form).
### 42. System calendar app synced to the user's accounts `[big]`
(Raised by Bernardo, 2026-07-08.) Clicking the Waybar **date/clock**
module should open a calendar that shows the user's real events, synced
from their calendar accounts (CalDAV / Google / Nextcloud / iCloud). Hard
requirement: it must open **instantly** on click — no Thunderbird/Evolution
multi-second cold start.
_Investigation (2026-07-08 — Bernardo suggested calcurse; asked for the
best approach):_ the winning shape is **split sync from display** — a sync
daemon fills a local store, a fast local viewer reads it instantly.
- **Recommended (most Nomarchy-native): `khal` (TUI) in a floating ghostty
window + `vdirsyncer` for sync.** khal reads a local vdir instantly →
opens immediately; running it in ghostty means it **themes for free** off
the palette (pillar 4, zero new theming surface) and slots into the
float+center windowrule pattern (item 41). vdirsyncer is the de-facto
CalDAV→local-ics sync (Nextcloud/Fastmail/iCloud with an app password are
frictionless). Configs are file-based → in-flake friendly.
- **calcurse (Bernardo's pick):** viable, instant TUI, single self-contained
tool — but it's *local-first*; `calcurse-caldav` multi-account/Google sync
is clunkier than vdirsyncer. Fine if a one-tool solution is preferred over
sync robustness.
- **GNOME Calendar + GNOME Online Accounts:** the GUI path with the *best*
Google onboarding (GOA handles OAuth cleanly), themes via GTK — but it's
heavier and pulls evolution-data-server + GOA, and first-open is **not
instant**, so it fails the core requirement. Fallback only if easy account
setup outweighs instant-open. (`gcalcli` = Google-only, not general.)
_Two real wrinkles to design around:_
1. **Credentials are secrets** — account passwords / OAuth tokens can't live
in the git-tracked flake, so this is the one legitimate exception to
"no state outside the checkout" (see [[in-flake-state-philosophy]]).
Decide: a plain runtime path (`~/.config`, documented exception) vs
sops/agenix encrypted-in-flake.
2. **Google OAuth friction** — vdirsyncer needs a *self-registered*
`client_id`/`client_secret` (shipping one violates Google ToS). CalDAV
app-password providers are painless; Google is the sharp edge. GOA
sidesteps it but only on the heavy GUI path.
_Slices (split before starting):_ (a) `[human]` pick the tool
(recommend khal+vdirsyncer; calcurse acceptable), then ship the viewer
bound to the clock `on-click` — launch it in a ghostty window with a
distinct `--class` so a float+center windowrule can target it; move the
current time↔date `format-alt` toggle to `on-click-right`/scroll; parity
across the four whole-swap jsoncs. Local-only first (an .ics on disk).
(b) add vdirsyncer + a sync systemd timer (like the update checker) + a
menu writer for accounts, resolving the secrets decision above. (c) optional
polish: upcoming events in the clock **tooltip** via a khal-backed script
(hover = next events, click = full calendar).
## LATER
- **Wallpapers artifact split** (ROADMAP § Faster switches — decided,