feat(waybar): open a calendar (calcurse) on the clock click
All checks were successful
Check / eval (push) Successful in 2m54s
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:
@@ -82,6 +82,22 @@ let
|
||||
[ -n "$next" ] && powerprofilesctl set "$next"
|
||||
'';
|
||||
|
||||
# Opens calcurse (a lightweight TUI calendar, month view by default) in a
|
||||
# floating, centered ghostty window — bound to the Waybar clock's on-click.
|
||||
# A distinct --class gives the window a matchable app-id for the
|
||||
# float+center+size windowrule (hyprland.nix); --gtk-single-instance=false
|
||||
# forces a fresh standalone window (ghostty defaults single-instance on).
|
||||
# calcurse ships uncommented in the downstream template (opt-out), so
|
||||
# self-gate with a helpful notify if it's been removed. ghostty is always
|
||||
# installed (ghostty.nix), so it can be relied on for the --class window.
|
||||
calendarLauncher = pkgs.writeShellScriptBin "nomarchy-calendar" ''
|
||||
if ! command -v calcurse >/dev/null 2>&1; then
|
||||
notify-send "Calendar" "calcurse isn't installed (removed from home.packages?)." 2>/dev/null
|
||||
exit 0
|
||||
fi
|
||||
exec ghostty --class=com.nomarchy.calendar --gtk-single-instance=false -e calcurse
|
||||
'';
|
||||
|
||||
# VPN indicator — shows a shield when a NetworkManager VPN/WireGuard
|
||||
# connection is active OR Tailscale is up; prints nothing otherwise so the
|
||||
# module self-hides (like nightlight/updates). Click opens the VPN submenu.
|
||||
@@ -154,10 +170,13 @@ let
|
||||
|
||||
clock = {
|
||||
format = "{:%H:%M}";
|
||||
format-alt = "{:%A %d %B %Y}";
|
||||
# Zone line first (LATER nicety): under auto-timezone the tz-watch
|
||||
# SIGUSR2 reload keeps it showing the currently *detected* zone.
|
||||
tooltip-format = "{:%Z (UTC%z)}\n<tt><small>{calendar}</small></tt>";
|
||||
# Left-click → the calendar (nomarchy-calendar → calcurse in a floating
|
||||
# ghostty). Replaces the old format-alt date toggle; the long date now
|
||||
# rides in the tooltip's first line, so nothing is lost on hover.
|
||||
on-click = "nomarchy-calendar";
|
||||
# The zone line stays live under auto-timezone (the tz-watch SIGUSR2
|
||||
# reload keeps it showing the currently *detected* zone).
|
||||
tooltip-format = "{:%A %d %B %Y}\n{:%Z (UTC%z)}\n<tt><small>{calendar}</small></tt>";
|
||||
};
|
||||
|
||||
# Active keyboard layout (per focused device) — only placed in
|
||||
@@ -431,5 +450,5 @@ in
|
||||
# whole-swap themes' static waybar.jsonc can exec them by name — plus
|
||||
# the supervisor hyprland.nix exec-onces.
|
||||
home.packages = lib.optionals config.nomarchy.waybar.enable
|
||||
[ waybarSupervisor powerProfileStatus powerProfileCycle vpnStatus doctorStatus ];
|
||||
[ waybarSupervisor powerProfileStatus powerProfileCycle vpnStatus doctorStatus calendarLauncher ];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user