1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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.
|