From 9adfac969af75a09054f1eb6f1894ab6bdf8b2a5 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 15 Sep 2026 16:53:34 +0200 Subject: feat: split the bar in two on DP-3 DP-3 is rotated, so a bar there is 1080px wide rather than 1920, and one bar holding every module was too crowded. Status sits on top now, the desktop itself along the bottom: workspaces on the left, open windows on the right. Both bars are one waybar process reading one stylesheet, because waybar takes a top-level array of bars, so the two cannot drift apart. Presentation mode is the statusctl-backed module the DP-1 bar already runs, rather than the wb-idle module written for this bar. It talks to files under XDG_RUNTIME_DIR instead of to quickshell, so it keeps working while the shell is down, and it already emits a state class, so the glyphs are simply dropped and the icon chosen in CSS. wb-idle and its module are gone. The module needs a format of one space. It defaults to "{text}", statusctl emits an empty text, and waybar draws no widget at all for a custom module whose formatted output is empty: not an empty pill, no pill. That is the same trap the launcher hit, and it cost a wrong diagnosis on the way: a min-height was added first on the theory that the pill was collapsing, which was treating a symptom of a widget that did not exist. A forced red background proved it was never drawn at all. Co-Authored-By: Claude Opus 5 --- bin/wb-icon | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'bin/wb-icon') diff --git a/bin/wb-icon b/bin/wb-icon index 9c29c60..b8f91cc 100755 --- a/bin/wb-icon +++ b/bin/wb-icon @@ -10,7 +10,6 @@ # # wb-icon volume # reads wpctl, prints the matching icon # wb-icon mic -# wb-icon idle # wb-icon --selftest # every name this bar asks for must resolve # # Icons keep their own colours: this desktop's icon theme draws them with @@ -44,10 +43,6 @@ ICONS = { "muted": "microphone-sensitivity-muted", "on": "audio-input-microphone", }, - "idle": { - "activated": "x-office-presentation", - "deactivated": "preferences-desktop-screensaver", - }, } @@ -116,9 +111,18 @@ def selftest(): ] clock_icons = ["x-office-calendar", "clock"] + # Presentation mode is a custom module: statusctl emits the state as a + # class and modules.css picks the icon, so these names appear nowhere in + # this file. They are still the bar's icons, so they are checked here. + presentation_icons = [ + "preferences-desktop-screensaver", # off + "x-office-presentation", # on + "dialog-warning", # no state file + ] + names = sorted( {n for group in ICONS.values() for n in group.values()} - | set(workspace_icons) | set(clock_icons) + | set(workspace_icons) | set(clock_icons) | set(presentation_icons) ) missing = [n for n in names if not lookup(n)] for n in names: @@ -156,13 +160,6 @@ def main(argv): label = "muted" if state == "muted" else f"{pct}%" return emit(ICONS["mic"][state], f"Microphone: {label}") - if what == "idle": - state = argv[2] if len(argv) > 2 else "deactivated" - state = state if state in ICONS["idle"] else "deactivated" - on = state == "activated" - return emit(ICONS["idle"][state], - f"Presentation mode: {'on' if on else 'off'}") - print(f"wb-icon: unknown subject {what!r}", file=sys.stderr) return 2 -- cgit v1.2.3