A status command for the Sway window manager’s built-in swaybar that allows sections of the bar to update independently. Each section updates at a regular frequency, and additional updates can be requested on-demand via a helper command and/or a background script. The sections are configured in a simple TOML file and communicate with the bar using the swaybar-protocol.
Here are a few of my configured sections that illustrate swaybar-commander’s capabilities:
- A date/time section shows the time down to the second, so it updates every second.
- A volume level section updates every 10 seconds, but an update is also triggered every time I use the volume up/down/mute keyboard shortcut.
- A network section shows the names of connected networks (e.g. the WiFi SSID) and refreshes every 60 seconds. It also uses a background script which runs
nmcli monitorand triggers a new update as soon as a network change is detected.