From be766471a40e6239540c35b25384508bb2864c79 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 19 Jun 2026 11:27:48 -0400 Subject: docs: spec out collapsible waybar sides A spike disproved the CSS / state-file approach. GTK3 has no display:none, so native modules go invisible but hold their space, and the bar never reflows. The mechanism is config-swap plus a SIGUSR2 reload, driven through an active config copied into XDG_RUNTIME_DIR so the toggle never rewrites the stowed canonical config. The spec locks the base sets (left: menu + workspaces; right: date + worldclock + tray), keeps the two sides independent, and stays host-agnostic: the base set is constant, the full set is whatever each host already defines. Spec and spike findings live under working/. --- todo.org | 5 +- .../collapsible-waybar-sides-spec.org | 120 +++++++++++++++++++++ .../collapsible-waybar-sides/spike-findings.org | 42 ++++++++ 3 files changed, 164 insertions(+), 3 deletions(-) create mode 100644 working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org create mode 100644 working/collapsible-waybar-sides/spike-findings.org diff --git a/todo.org b/todo.org index a71fd3c..196b882 100644 --- a/todo.org +++ b/todo.org @@ -105,10 +105,9 @@ Implementation notes (to flesh out when picked up): waybar =custom= module(s) wi :END: Let either side of the waybar collapse horizontally to a minimal base set, toggled by a click. Each collapsible side carries a small triangle / arrowhead pointing toward the screen edge it collapses into (away from center). Clicking it collapses that side to its base set and flips the arrow to point back toward center; clicking again restores the full side. Same shape-changes-with-state idea as the auto-dim indicator. -- *Right-side base set* (proposed): the date/time, optionally plus the systray. Everything else on the right (sysmonitor group, netspeed, pulseaudio, the toggles) hides. -- *Left-side base set*: TBD (workspaces only, or menu + workspaces). +Spec ready (2026-06-19): [[file:working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org]]. Spike settled the mechanism: [[file:working/collapsible-waybar-sides/spike-findings.org]]. -Implementation notes: waybar has no native per-side collapse, so this is custom. Options to explore: (a) swap between a full and a collapsed waybar config on click via a signal/exec, (b) rewrite the modules array and reload (heavy), (c) a state file the modules read to hide/show a group via CSS. Likely a state file (=$XDG_RUNTIME_DIR=) + per-side toggle scripts + a targeted waybar refresh, mirroring the existing custom-module + signal pattern. Lives in the dotfiles repo (=hyprland/.config/waybar/= + =hyprland/.local/bin/=). TDD the toggle scripts per the dotfiles suite. +Decisions locked: right base set = date + worldclock + tray; left base set = menu + workspaces; per-side independent; host-agnostic (base set constant, full set is each host's existing config). Mechanism = config-swap + SIGUSR2 reload via an active-config copy in =$XDG_RUNTIME_DIR= (the CSS/state-file approach was disproven — GTK3 can't reflow-hide native modules). Lives in =~/.dotfiles/hyprland/=. Next: implement per the spec (TDD the toggle + arrow scripts). ** TODO [#B] Network-manager dropdown, nmcli-backed with GPG-stored secrets :waybar:network: :PROPERTIES: diff --git a/working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org b/working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org new file mode 100644 index 0000000..b9ddc0d --- /dev/null +++ b/working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org @@ -0,0 +1,120 @@ +#+TITLE: Collapsible waybar sides — implementation spec +#+AUTHOR: Craig Jennings & Claude +#+DATE: 2026-06-19 + +* Goal +Let each side of the waybar collapse to a minimal base set with a click, and +expand again with another click. Each side carries a small arrowhead that points +toward the screen edge when expanded (click to collapse outward) and flips to +point toward center when collapsed (click to expand). Left and right collapse +independently. + +This is dotfiles work (=~/.dotfiles=, =hyprland/= tier). Tracked by the +=Collapsible waybar sides= task in archsetup =todo.org=. + +* Decisions (locked 2026-06-19) +- *Mechanism*: config-swap + =killall -SIGUSR2 waybar=. NOT state-file + CSS — + the spike proved CSS can't collapse native modules (they go invisible but hold + their space; GTK3 has no =display:none=). See [[file:spike-findings.org]]. +- *Right base set*: =custom/date=, =custom/worldclock=, =tray= (plus the right + arrow). Tray reflows cleanly and survives the reload (spike-confirmed). +- *Left base set*: =custom/menu=, =hyprland/workspaces= (plus the left arrow). +- *Per-side*: left and right toggle independently, each with its own arrow. +- *Per-host*: host-agnostic. The base set is constant; the full set is whatever + each host's config already defines. ratio (no battery/touchpad/airplane) needs + no special-casing — collapse hides whatever modules that host has. Build once. + +* Architecture + +** The active-config indirection (the core piece) +=~/.config/waybar/config= is a stow symlink into the dotfiles, so the toggle +can't rewrite it in place (that would edit the repo). Instead: + +1. *Canonical* config: the committed dotfiles config. Always holds the FULL + module arrays. Read-only source of truth. Unchanged by this feature except + for adding the two arrow modules and their definitions. +2. *Active* config: a generated copy at =$XDG_RUNTIME_DIR/waybar/config=. This is + what waybar loads (=waybar -c=). The toggle rewrites its =modules-left= / + =modules-right= between full and base. +3. *Launch change* (hyprland.conf exec-once): before launching waybar, generate + the active config from the canonical (initial state = expanded/full), then + =waybar -c "$XDG_RUNTIME_DIR/waybar/config" -s