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/. --- .../collapsible-waybar-sides-spec.org | 120 +++++++++++++++++++++ .../collapsible-waybar-sides/spike-findings.org | 42 ++++++++ 2 files changed, 162 insertions(+) create mode 100644 working/collapsible-waybar-sides/collapsible-waybar-sides-spec.org create mode 100644 working/collapsible-waybar-sides/spike-findings.org (limited to 'working') 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