// Presentation mode, the same module the DP-1 bar runs. // // `statusctl presentation watch` streams waybar JSON on every change: it // already emits an empty text and a class of activated or deactivated, so the // icon is chosen in CSS from that class and no format is needed here. Dropping // format-icons is the whole difference from the DP-1 copy, which draws the // same two states as Nerd Font glyphs. // // A missing state file reads as deactivated, not as a warning: that is the // normal state before anything has written one, and a file cannot report // whether a watcher is alive anyway. // // A third class, gaming, covers the mode being held on by a running game: the // shell's detector owns status.gaming and presentation is the OR of the two, // so a game turns the mode on without touching the manual half. The click is // inert in that state, statusctl refuses the toggle, because the detector // would reassert it within its poll anyway. // // statusctl talks to files under XDG_RUNTIME_DIR rather than to quickshell, // so this keeps working while the shell is down. // The format is a single space, and it has to be something. 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. A space gives the label real content to be allocated for, shows // nothing itself, and leaves the icon to the CSS background. { "custom/presentation": { "exec": "$HOME/bin/statusctl presentation watch", "return-type": "json", "on-click": "$HOME/bin/statusctl presentation toggle", "format": " ", "tooltip": true } }