From e33abe6fd6bde995c3f067ca023dd8f158e8cfe9 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 27 Jun 2026 12:18:04 -0400 Subject: docs: file collapsible-waybar-sides spec to assets, close task --- ...-18-collapsible-waybar-sides-spike-findings.org | 42 ++++++++ .../2026-06-19-collapsible-waybar-sides-spec.org | 120 +++++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 assets/2026-06-18-collapsible-waybar-sides-spike-findings.org create mode 100644 assets/2026-06-19-collapsible-waybar-sides-spec.org (limited to 'assets') diff --git a/assets/2026-06-18-collapsible-waybar-sides-spike-findings.org b/assets/2026-06-18-collapsible-waybar-sides-spike-findings.org new file mode 100644 index 0000000..4d45ed1 --- /dev/null +++ b/assets/2026-06-18-collapsible-waybar-sides-spike-findings.org @@ -0,0 +1,42 @@ +#+TITLE: Collapsible waybar — spike findings (mechanism) +#+DATE: 2026-06-18 + +* Question +Which mechanism actually collapses a waybar side to a base set, given the right +side is a mix of native modules (group/sysmonitor, pulseaudio, pulseaudio#mic, +idle_inhibitor, tray) and custom exec modules? + +* Method +Two transient waybar instances against /tmp copies of the live config, captured +with grim (live bar briefly down, restored after). Variants in this dir: +- spike-style-csshide.css : option (c) — CSS-hide the native modules + (min-width:0; padding:0; margin:0; opacity:0) on #sysmonitor #pulseaudio + #idle_inhibitor. +- spike-config-collapsed.json : option (b) — modules-right rewritten to the base + set [tray, custom/date, custom/worldclock]. + +* Result +- *CSS-hide (option c): FAILS.* sysmonitor and pulseaudio rendered invisible but + held their space — a gap remained where they were, no reflow. GTK3 has no + =display:none=, and opacity/zero-size leaves the label's intrinsic width. The + right side ends up ragged and half-collapsed, not narrowed. Not viable for the + native modules. +- *Config-swap (option b): WORKS.* The collapsed config reflowed the right side + tight to tray + date, everything else fully gone, no gaps. Hides native and + custom modules alike. Tray icons survived the swap. + +* Decision +Mechanism is config-swap + =killall -SIGUSR2 waybar= (reload), NOT the state-file ++ CSS approach the original task leaned toward. The original "heavy" label on +option (b) is the cost of a full reload (brief flicker, module state resets, tray +re-registers) — acceptable, and the only approach that actually collapses a mixed +module set. + +* Implications for the spec +- Don't maintain two static configs (drift-prone). A toggle script rewrites the + active config's modules-left / modules-right between the full set and the base + set, then SIGUSR2. Base sets defined once; collapsed set is the base set, full + set is restored from the canonical module list. +- Per-side state in $XDG_RUNTIME_DIR; the arrow module reads it to pick its + direction. Arrow lives IN the base set (always visible, it's the expand control). +- Reload cost is per-toggle, not idle — fine for a click action. diff --git a/assets/2026-06-19-collapsible-waybar-sides-spec.org b/assets/2026-06-19-collapsible-waybar-sides-spec.org new file mode 100644 index 0000000..b9ddc0d --- /dev/null +++ b/assets/2026-06-19-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