Modules
Each module has its own section here. Place a module by id in --left/--center/--right or the file’s left/center/right lists.
Modules
Section titled “Modules”| Id | Shows | Wakes |
|---|---|---|
clock |
The local time (below) | its timer: once a minute, or once a second with seconds shown (each redraw adds the compositor’s release, below) |
workspaces |
Each output’s workspace numbers, the active one marked (below) | on the compositor’s workspace changes: one redraw per batch, however many events it held |
window-title |
The focused window’s title on the bar’s own output (below) | on the compositor’s toplevel changes: focus at once, retitles at most ten times a second |
minimap |
The current workspace’s columns as blocks, the focused one in the accent (scoot only, below) | on scoot’s columns event: at most once per output per frame, and only when that output’s strip changed |
volume |
The default sink’s level and mute (below) | on the sound server’s sink events, and the server’s own: one redraw per batch |
microphone |
The default source’s level and mute (below) | as volume, for sources |
battery |
The batteries’ charge and state (below) | on the kernel’s power-supply events, and once a minute while discharging |
network |
The shown interface’s state: name, SSID, VPN or offline (below) | on the kernel’s link, address, route and WiFi events: one redraw per batch, however many events it held; plus the WiFi signal re-read every 10 s while WiFi is shown (two wakes a tick, a redraw only when the shown level moves) |
brightness |
The panel backlight’s level (below) | on the kernel’s backlight events: one redraw per batch, however many events it held |
tray |
The applications’ tray icons, StatusNotifierItem (below) | on the session bus’s traffic: item registrations, icon changes, owners vanishing |
media |
What the players on the session bus are playing, and their controls, over MPRIS (below) | on the bus’s MPRIS traffic only: a player appearing or vanishing, its track or state changing |
bluetooth |
The adapter’s power and the connected devices over BlueZ, on the system bus (below) | on the bus’s BlueZ traffic only: BlueZ appearing or leaving, an adapter or device coming or going, power, connection, name or charge changing |
power |
Lock, log out, suspend, reboot and shut down from a popup menu with a confirm step (below) | on nothing while closed: the popup’s Can* round trips and its own replies only |
A build can leave a module out (cargo build --no-default-features, then
--features clock); naming one that is not built is a usage error that
lists those that are. Every module takes the five
interaction keys. The config can also define
modules of its own by name: a button, a push and an exec
module, each a Cargo feature (button,
push, exec) on by default. The popup feature is not a module: it is the
popup code the volume and microphone modules use, on
by default. A build without it has no popups and does not bind
xdg_wm_base. The icon-image feature adds the PNG
decoder for image icons and is off by default.
The clock
Section titled “The clock”The local time, in the format --clock-format gives, a small strftime
subset. The default, %-I:%M %P, is a 12-hour clock with no leading zero:
3:07 pm. %H:%M is the 24-hour one: 15:07.
| Specifier | Shows | Specifier | Shows |
|---|---|---|---|
%H |
hour, 00-23 |
%I |
hour, 01-12 |
%k |
hour, 0-23 (space-padded) |
%l |
hour, 1-12 (space-padded) |
%M |
minute, 00-59 |
%S |
second, 00-59 |
%p |
AM or PM |
%P |
am or pm |
%a |
Mon |
%A |
Monday |
%b, %h |
Sep |
%B |
September |
%d |
day, 01-31 |
%e |
day, 1-31 (space-padded) |
%m |
month, 01-12 |
%j |
day of the year, 001-366 |
%y |
year, two digits | %Y |
year |
%u |
weekday, 1-7 from Monday |
%w |
weekday, 0-6 from Sunday |
%Z |
zone abbreviation (EDT, +0530) |
%z |
offset from UTC, +hhmm |
%R |
%H:%M |
%T |
%H:%M:%S |
%F |
%Y-%m-%d |
%D |
%m/%d/%y |
%% |
a % |
- Padding flags, as GNU
date: between the%and the letter,-drops a number’s padding (%-dis5),_pads it with spaces and0with zeros (%_His7). - A space pad never opens the label.
%k,%land%ekeep their space mid-format, where it lines up a column (%a %e %bisMon 5 Jan), but drop it when they come first:%l:%Mshows9:05, not9:05. To keep a leading space, write%_l. - English names, no locale lookup: day and month names and
AM/PMare the C locale’s, whateverLANGsays. - Everything else in the format is shown as it is, any Unicode included (as long as the font has it).
- Its timer fires once a minute (on the minute), or once a second
when the format shows seconds (
%S,%T). It does not poll. Each tick that changes the text is one frame, and the compositor answers each frame with onewl_buffer., so an idle minute clock wakes the bar twice a minute (What it does on the compositor).release - The time zone is read as glibc reads it:
$TZif set (a zone name such asEurope/London, looked up under$TZDIRor/usr/share/zoneinfo; an absolute path, with or without a leading:; or a POSIX rule such asEST5EDT,M3.), else2. 0,M11. 1. 0 /etc/localtime. An empty$TZis UTC. A POSIX value naming summer time but no dates (TZ=EST5EDT) takes glibc’s default US rules, asdatedoes. A zone that cannot be read is shown as UTC, with one line on stderr saying why; the bar still starts. - A new zone shows at the next tick:
/etc/localtime(or the file$TZnames) is checked once each wake, sotimedatectl set-timezonetakes effect within the minute. A zone file that disappears keeps the zone last read until one is back. - Clock steps, suspend and summer time: any step of the wall clock (NTP,
date -s, a resume from suspend) cancels the timer and wakes the bar at once to redraw. A summer-time change shows at the first tick after it.
Workspaces
Section titled “Workspaces”Each output’s workspace numbers, over ext-workspace-v1, with the
active one marked by a pill in the accent color (its number drawn in the
bar’s background). The bar shows one number per workspace the compositor reports for the
output it is on, sorted by position, with no fixed slots. A workspace adopted from an unplugged monitor shows
its number ("2 DP-1" shows 2). A name with no leading number (a foreign
compositor’s free-form name) shows its 1-based position.
Click a number to show that workspace: the bar sends activate for it
and commits the batch. Clicking the active one sends nothing. A click on
a non-focused output’s bar is dropped by scoot today (it takes no output),
so on a second monitor’s bar use focus-output first, then click.
- The pill is a square tile by default (shape
squarewith radius 3, lifted 6 off the bar’s top and bottom); its shape is configurable: square, rect, a pill, or a circle. - The protocol is bound only while the module is placed. A bar with no
workspaces module never binds
ext_workspace_manager_v1orwl_seat, so it wakes for none of it. Ascootbar msg reloadthat adds the module binds both; one that removes it releases them (a seat below version 5 cannot be released and stays bound). A compositor that starts advertising the protocol later is bound if the module is placed. One that finishes the manager and re-advertises it is not rebound until a reload removes and re-adds the module. - Without
ext-workspace-v1the module shows nothing (one stderr note at start-up says the protocol is missing) and takes no space. Withoutwl_seatclicks do nothing (also noted on stderr; see Pointer input). The bar still starts and the clock is unaffected. - The list grows and shrinks with the trailing empty workspace,
renumbering what follows. Only the
activestate is shown; occupied and urgent are not.
The active workspace’s pill
Section titled “The active workspace’s pill”[workspaces] shapes the pill behind the active number (all file-only,
logical pixels; the defaults are the square tile: shape square with
radius 3, inset 6, disc growing the span, and three spaces between
the numbers):
| Key | Values | Meaning |
|---|---|---|
pill-shape |
"square" (default), "rect", "pill", "circle", "underline" |
square: at least as wide as tall, centered on the number, corners per pill-radius — a single digit sits in a square tile at any padding. rect: the item’s extent, corners per pill-radius. pill: the same extent with ends as round as fit (half circles). circle: at least as wide as tall, centered on the number. underline: no fill; the active number in the text color over a 2 px bar in active-color (else accent) along the bottom of the pill’s rows, as wide as the number plus a quarter of padding on each side. |
pill-radius |
0 to 1024 (default 3) | a rect’s or square’s corner radius, cut back to half its shorter side. Refused with pill or circle, which are already as round as they fit, and with underline, which has no corners. |
pill-inset |
0 to 1024 (default 6) | the gap from the bar’s top and bottom edges, so the pill is shorter than the bar. Cut back so the pill is never shorter than the text’s line: the number is drawn in the bar’s color over the fill, and a shorter pill would clip it away. |
item-gap |
1 to 8 (default 3) | the spaces between two numbers: one space is about a third of the font size, so 3 (the default) is a roomy row and 1 the old tight one. The active pill reaches half of [bar] padding past its number, so the gap needs to be wider than that for the pill to stay clear of the next number: Afterglow, Hearth and Linen (padding 14) set 4. The pill and the click target of each number follow; a click in the gap hits nothing. The module’s text is cut at 256 bytes, so a bigger gap shows fewer workspaces: at the default 3, workspaces 1 to 53 fit; at 8 spaces about 26 numbered up to 99 (28 single-digit ones), the rest cut off the end. |
display |
"numbers" (default), "dots" |
dots: a dot per workspace in place of the numbers — the active one filled like the pill, the rest dim (or the state colors above). Clicks land by the dots’ places, exactly as by the numbers’. A query still reports the numbers. |
disc |
on by default | with a circle or square pill: grow the module’s own span to the shape’s side, so a single digit is a disc or tile at any padding. Set explicitly, it is refused with any other shape and with dots. |
active-color |
a color, unset by default | the active pill’s fill instead of accent. The pointer’s hover still wins while it is over the module. |
inactive-color |
a color, unset by default | inactive numbers’ ink instead of fg (inactive dots are dim unless set). |
# A rounded pill, lifted 4 off the bar's edges[workspaces]pill-shape = "pill"pill-inset = 4# The active number underlined instead of filled; the others dimmed[workspaces]pill-shape = "underline"pill-inset = 5 # lifts the underline 5 off the bar's bottom edgeinactive-color = "#8e918d"# More room between the numbers (each number's pill and click target follow)[workspaces]item-gap = 4# A circle around a one-digit number[bar]padding = 10 # the circle can be as wide as the module: see below[workspaces]pill-shape = "circle"pill-inset = 3# A square tile around a one-digit number (the default look, spelled out)[workspaces]pill-shape = "square"pill-radius = 3pill-inset = 6disc = true # grow the span to the tile, so it stays square- How a circle is sized: its diameter is the pill’s height (the bar’s
height less twice the inset). A two-digit number widens the circle into
a pill as wide as the text needs, never a clipped disc. Growth is
limited to the room around the number: it stops at a neighbouring
number’s ink, and cannot pass the module’s own span (the numbers plus
paddingeither side). So on a crowded bar, or one whosepaddingis small next to its height, a single digit gets an oval rather than a disc: raisepaddingor thepill-insetuntil it is round, or setdisc(on by default) to grow the span to the disc instead; a config that setspill-shape = "circle"but neverdiscnow grows its span too, so setdisc = falseto keep the old layout. - How a square is sized: like a circle but square — its side is the
pill’s height, centered on the number, corners per
pill-radius. A wider number widens it into a wider tile, never clipped, stopping short of the neighbours the same way. Withdisc(the default) the span grows to the tile, so a single digit is square at anypadding. - Where the underline sits: on the last two rows of the pill’s rows
(the bar’s height less
pill-insetat the top and bottom, cut back to the text’s line), sopill-insetmoves it up or down. Under the pointer it takes thehovercolor, as the pill would.discis refused with it (there is no shape to grow). - Clicks follow the pill: a press on the drawn pill of the active number does nothing (it is already shown), never a neighbour’s switch, even where a grown circle or tile overlaps the neighbour’s own click area; a press on the padding around any other number still activates that workspace.
- Not built: urgent and occupied workspace
colors. The bar reads only the protocol’s
Activestate.
Window title
Section titled “Window title”The focused window’s title on the output the bar is on, spoken over
wlr-foreign-toplevel-management-v1. Each output shows the title of the
window activated on it; with none focused the module shows its
placeholder (empty by default, taking no space at all).
- Title and app id. The title alone, or
title - appwithwindow-title.; a window with an empty title shows its app id, so something is shown whenever a window is focused. A staticshow-app-id window-title.stands before the title whenever a window is focused (never for the placeholder;icon window-title.draws only the icon — see Per-state and per-level icons). The full title is the tooltip (and theshow-text = false queryvalue’stitle), uncut by the span. - The app’s color dot. Where no icon is set, a small disc in the
window’s app color leads the title: the same color its launcher tile and
notification cards carry.
window-title.turns it off.app-dot = false - Width. The span never grows past
window-title.(default 480 logical pixels, 1 to 4096), so the title yields the bar to the other modules; a longer title is cut with an ellipsis by measured pixel width, never counted in characters.max-width - Click to focus. A left click activates the window (as
scootbar msg invoke window-title activatedoes). A middle click closes it only withwindow-title.(off by default: closing a window by an accidental click loses work); namingallow-close = true closein a binding with closing off is refused when the file is read. The module’s own actions areactivateandclose, both taking no number. - Cost. Event-driven, no polling: the protocol is bound only while the module is placed, and without the protocol the module shows nothing and takes no space. A retitle flood draws about ten times a second (focus, output, close and fullscreen changes always draw at once; only title and app-id text waits), and only this module’s span is redrawn. Titles are untrusted text: kept at 256 bytes, with control characters stripped.
- Only the wlr protocol. The module binds
wlr-foreign-toplevel-management-v1; the newerext-foreign-toplevel-list-v1has no activation state or requests.
Column minimap
Section titled “Column minimap”The current workspace’s columns as a row of small blocks in a capsule, after the workspace numbers: each block as wide as its column, the focused column in the accent, the part of the strip on screen outlined. Each bar shows its own output’s strip.
left = ["workspaces", "minimap", "window-title"]- Click a block to focus that column, on whichever output it is;
scroll over the minimap to move focus one column left or right. The
module’s actions are
focus N(theNth block, 1 first),previousandnext(a scroll of several notches moves that many columns, stopping at the ends):scootbar msg invoke minimap focus 2 --output DP-1. - What it shows. Blocks fill the capsule exactly when the columns fill the screen: one half-width column takes half of it, and a strip wider than the screen is squeezed in whole, with the outline marking what is on screen. Every block stays at least 3 pixels wide. When even that does not fit, the blocks around the focused column are shown, with a dot at each side that has more. A column stacking several windows is split into that many segments, up to four.
- Colors are the apps’. Each block takes its column’s app color
(from the focused window’s app id: the color its launcher tile and
notification cards carry), the focused block whole and the others at
half strength.
active-colorset, the focused block takes it instead. A column whose window names no app, and every block withapp-colors = false, falls back to the look: the focused blockaccent, the others the foreground at the state ladder’spressedstep (22 % by default), blended over the bar’s own fill; the outline and the overflow dots aredim, andhoverwhile the pointer is over the module. - Height matches the workspaces pill: the capsule takes the
workspaces
pill-insetunless[minimap] pill-insetsays otherwise. - Needs scoot. The module subscribes to scoot’s
columnsevent on its control socket ($SCOOT_SOCKET, elsescoot.insock $XDG_RUNTIME_DIR; see events). Under another compositor it is left out with one line on stderr and takes no space. - A dropped connection reconnects. scoot drops a subscriber that
stops reading (a bar paused under a debugger while windows churn). The
minimap then hides at once, so nothing stale is drawn or clicked, and
subscribes again: at once, or after a backoff from 1 to 60 seconds when
scoot is not answering. The log says
minimap: scoot closed the columns subscription; subscribing again. - Cost. One connection, held. Nothing polls: scoot sends a snapshot only when an output’s strip changes (at most once per frame), the module redraws only when the snapshot differs from the last one it drew, and an idle bar wakes for nothing.
| Key | Type | Default | Meaning |
|---|---|---|---|
app-colors |
bool | true |
Draw each column in its window’s app color (the focused one whole, the others at half strength). false uses accent and the foreground, as below. |
max-width |
logical pixels, 16 to 512 | 56 |
The capsule’s width. It stays this wide whatever the columns do, so the bar never re-lays out as windows come and go. |
show-empty |
bool | true |
On an empty workspace, show an empty capsule (true) or hide the module and its space (false). |
stack |
bool | true |
Split a column with several windows into segments. |
active-color |
color | accent |
The focused block’s fill. |
pill-inset |
logical pixels, 0 to 1024 | the workspaces pill-inset (6) |
The capsule’s gap from the bar’s top and bottom, cut back so it stays as tall as the text line. |
margin |
logical pixels | 0 |
Extra room each side, as for every module. |
Every key applies on scootbar msg reload, which restarts the module.
# A wider minimap with no empty capsule[minimap]max-width = 80show-empty = falseSymptom: the bar’s log says
minimap: cannot subscribe to scoot's columns at ...and the module is missing. The bar is not running under scoot, or its environment points at another session: check/scoot. sock: No such file or directory SCOOT_SOCKETandXDG_RUNTIME_DIRin the bar’s environment.
Symptom: the log says
minimap: scoot refused the columns subscription. The running scoot predates thecolumnsevent: update scoot (the bar and the compositor are released together).
Volume
Section titled “Volume”The default sink’s level and mute, over the PulseAudio native
protocol (PipeWire’s pipewire-pulse answers it, as does PulseAudio
itself). The microphone module is the same code for the default
source (its level and mute, the source key in query), configured under
[microphone]. Each is a Cargo feature (volume, microphone), both on
by default.
- What it shows is
49%with the level’s icon (muted, low, medium, high; a staticicon,icon-pathoricon-imagein the table replaces all four — see Icons), in themutedclass while muted. The tooltip names the device:Built-in Audio: 49%, with(muted)after it. While no server answers it shows nothing and takes no space. - A click toggles mute, a scroll raises or lowers, with no binding at
all; a binding you set runs instead, as on every module. The module’s
own actions are
raise,lowerandtoggle-mute, none taking a number (scootbar msg invoke volume raiseraises one step),set N, which sets the level toNpercent (held to 0 andmax-volume, whatever number is given), andpopup, which opens the slider popup (on-click = "popup"). A scroll’s steps arrive through the scroll itself, one step each. There is no default for a right click: pointon-right-clickat a mixer (pavucontrol, orwpctl). step(default 5, 1 to 50) is the percent points per scroll notch and per raise.max-volume(default 100, 100 to 150) is the cap a raise stops at: 100 is full scale, past it is over-amplification.- Cost. One socket while the server is up, one inotify watch on its
directory while it is not: no timer, no polling, no wakeups with no
audio activity. A server that restarts is found when its socket comes
back, or at once when it kept the path and only dropped the connection.
A server that refuses the handshake (a cookie) is not probed again
until something new happens in the socket’s directory. Sets are absolute levels from what is shown
(never accumulated steps, so a touchpad flood cannot drift), one in
flight at most, and every answered set is re-read, so what the server
clamped to is what is shown. The server is
$PULSE_SERVERwhen that names a unix socket, else$XDG_RUNTIME_DIR/pulse/native. Device names are untrusted text, kept at 128 bytes.
Network
Section titled “Network”Link state, WiFi name and signal, over rtnetlink and nl80211. A
Cargo feature (network), on by default.
- What it shows is one interface’s state: the default route’s (the
first usable, v4 before v6), or
network.by name. Ethernet shows the name (interface eth0); WiFi shows the SSID (Wimbly); a tunnel showsVPN(in the normal class: being on a VPN is not a warning, onlyofflinewarns); anything without an address showsoffline, in thewarnclass. A second VPN up beside the shown interface appends· VPN. The tooltip adds the signal (Wimbly · −54 dBm on wlan0). Before the first event it shows nothing and takes no space. An icon can stand before the text, or alone:icon,icon-pathwithicon-viewbox, oricon-image(at most one, as the clock’s) for every state, or one glyph each inicon-ethernet,icon-wifi,icon-vpnandicon-offline. The wired, tunnel and offline states also take SVG path data (24 by 24) inicon-ethernet-path,icon-vpn-pathandicon-offline-path, one form per state, as the built-in default bar does; see Per-state and per-level icons. The WiFi level is four at −55 dBm and better, one at −78 and worse, asquery’sbarscounts it. - At idle on WiFi the bar wakes about twice every 10 seconds: the signal has no kernel event, so the module re-reads it on a 10 s timer, armed only while WiFi is shown. A redraw follows only when the shown level moves. The tooltip’s exact dBm comes from the latest re-read, so it is fresh whenever it opens, and an open tooltip refreshes with the next redraw.
- A click opens the picker, with no binding at all:
network.is spawned with the cached scan’s SSIDs on stdin (one per line), a dmenu-style launcher fed from the scan list. Connecting is up to the command, for examplemenu-command menu-command = ["sh", "-c", "fuzzel --dmenu | xargs -d '\\n' -r -n1 nmcli device wifi connect"](no shell sees the SSID: it travels by pipe intoxargs, which passes it as one argument). Withshow-ssid = falsethe picker refuses to open instead: the scan list would expose the SSIDs the bar hides. The module’s own action ismenu, taking no number (scootbar msg invoke network menu); it is refused, with the reason, when no command is configured or no networks were seen. A secondmenuwhile one runs ends the running picker and opens a fresh one, so a picker left open never blocks the next. Only a menu that will open ends the old one. - A native list, opt-in as the volume popup is:
on-click = "popup"opens the scan as a popup list instead of the dmenu picker (the click binding wins over the picker’s default). Each row names a network, starting with its strength glyph whereicon-wifinames four glyphs and the scan carries a signal (a row with no signal carries none), and the associated one selected; a wheel over the list scrolls it a row a notch where the popup is taller than what the compositor configures for it, and a row too wide for it is cut with an ellipsis. Selecting a row closes the popup and runsconnect N(scootbar msg invoke network connect 1connects to the list’s row 1):network.is spawned with the SSID as its last argument, never through a shell (SSIDs are attacker-controlled radio data; invalid UTF-8 and control characters become U+FFFD, so a bad name fails rather than landing on another network). The argument is the SSID the row names (never its strength glyph). The list holds at most 16 rows: a scan with more shows the first 16, and the picker still lists them all.connect-command Nnames what the list showed: a scan that moved underneath is refused rather than connected to the wrong network.connectis refused naming why with no command configured, a row past the list or gone from the scan. A secondconnectwhile one runs ends the running command (SIGTERM to its process group, then SIGKILL after 100 ms) and starts the new one, so a hung command never blocks the next connect; only aconnectthat will start ends the old one, and a refused one leaves the running command alone. A reload or removal of the module ends both children the same way. Withshow-ssid = falsethe list stays closed, as the picker does. interface(1 to 15 bytes, a kernel interface name) pins what is shown; absent is the default route’s, tracked by index so a rename keeps it.show-ssid(default true) hides the SSID when false — the bar showsWiFi, andqueryomits the SSID — because the bar is visible in screenshots and to an agent’squery.- Which interface’s scan is listed. The picker and the popup list the shown interface’s scan where it is a scanning station; where the shown interface is not wireless (ethernet, a tunnel, offline), they list the associated station’s instead — or, with none associated, the first idle station’s, so the picker still works off-network. An interface in AP mode (an access point, its VLAN, a P2P group owner) has no useful scan: its cache is never dumped and never listed, so a hotspot beside the station cannot empty the list. A second station’s cache is never listed either: only the target above is dumped. The default route moving to another radio re-dumps the scan there; the shown radio vanishing falls back to the associated station that is left.
queryreports{"state": "wifi", "ssid": "Wimbly", "signal": -54, "bars": 4, "interface": "wlan0", "vpn": false},"ethernet"and"vpn"with the interface, or{"state": "disconnected"}.- Cost. Event-driven, no polling, except the 10 s signal re-read while WiFi is shown (signal has no event on drivers without CQM). Where the machine has no network interface, the module shows nothing. Interfaces that appear later (a
plugged-in dongle) are picked up by
scootbar msg reload.
Brightness
Section titled “Brightness”The panel backlight’s level in percent, read from /sys/class/backlight.
A Cargo feature (brightness), on by default.
- What it shows is
49%, with an icon per level when configured (brightness.takes one glyph, or 4 for the levels;icon brightness.draws only the icon — see Per-state and per-level icons). The tooltip names the device:show-text = false apple-panel-bl: 49%. Where there is no backlight at all (a desktop, a VM) it shows nothing and takes no space. - A scroll raises or lowers, with no binding at all; a binding you set
runs instead, as on every module. The module’s own actions are
raiseandlower, neither taking a number (a scroll’s steps arrive through the scroll itself, one step each), andset, taking the absolute percent (scootbar msg invoke brightness set 50). There is no default for a click: there is nothing to toggle. devicenames the backlight where the machine has several (intel_backlightbesideacpi_video0); absent is the first usable one in sorted name order.step(default 5, 1 to 50) is the percent points per scroll notch and per raise.- Writes need permission: the bar writes the raw value to the device’s
brightnessfile directly, and a udev rule for the backlight class or thevideogroup grants it. Without it the action is refused and says so. Every write is an absolute level from what is shown (never accumulated steps, so a touchpad flood cannot drift), re-read before the call returns, and never below raw 1: 0 blanks the panel on some drivers, and the bar never darkens its own screen past what a scroll can bring back. - Cost. No timer, no polling, no wakeups with no backlight activity. A device with a zero range or a missing file is skipped.
Battery
Section titled “Battery”The batteries’ charge in percent, read from /sys/class/power_supply.
A Cargo feature (battery), on by default.
- What it shows is
72%, in thewarnclass at or belowwarn-below(default 20) andurgentat or belowurgent-below(default 10, 0 to 100 each), by level alone;warn-belowmust be at leasturgent-below, else warn is unreachable and the file is refused. The tooltip names the state:Discharging 72%(Charging,Full,Not chargingorUnknownfor a status string no kernel documents, which never refuses the battery). An icon stands before the percent when configured (battery.takes one glyph, or 5 for the charge levels, withicon battery.andicon-charging battery.for those states;icon-full battery.draws only the icon — see Per-state and per-level icons). Where there is no battery at all (a desktop, a VM) it shows nothing and takes no space.show-text = false - Several batteries are combined by default (
batteries = "combine": the mean capacity, discharging winning the state), or the first in sorted name order withbatteries = "first". A battery removed at runtime hides the module until one is back, with one stderr line. A reinserted battery shows again with no polling. The percentage always comes fromcapacity, nevercharge_now/charge_full(about 4 points apart at full). No time-remaining is shown. on-low = { exec = [...runs once per downward crossing of] } urgent-below(and re-arms when the level rises back above, so the next crossing fires again; starting below it is not a crossing). It runs like a click binding: never through a shell, and bounded as in Pointer input. The module defines no actions of its own, so its five interaction keys take commands only.- Cost. One wake per kernel event, whatever the subsystem (filtered in userspace), and a re-read once a minute only while discharging (capacity steps while discharging emit no uevents, so the timer sees them). Charging, full and absent batteries own no timer. A capacity past 100 is clamped; an unparsable one skips its battery.
The applications’ tray icons: the StatusNotifierItem watcher and host over
the session bus, one icon per item, drawn at the output’s real device
pixels. A Cargo feature (tray), on by default; the smallest build
(--no-default-features) has none of it.
-
The bar is the watcher. It owns
org.(and thekde. StatusNotifierWatcher org.twin) when they are free, answers apps’ registrations itself, and re-takes the name if its owner leaves. Where another process already owns it (a desktop’s own tray), the bar hosts against that watcher instead: its items still appear, a click still works, and the bar takes over when that owner goes. Items already registered are found by listing the bus’s names at connect; an item behind a plain unique name is seen only if it registers after the bar is up. With no session bus the module shows nothing and waits for it, and a bus that dies mid-run drops every icon at once and dials once more. A bus that takes the bar and drops it within 5 s three times running is retried after 30 s, and again each time that try dies the same way, or as soon as its socket is made anew (for an abstract address, at the next 30-second poll). Only the bus’s ownfreedesktop NameOwnerChangedis believed (a peer’s, addressed to the bar, removes nothing). A policy denyingownof the watcher name is said once on stderr, and the bar hosts. The address isDBUS_SESSION_BUS_ADDRESSwhen it names aunix:socket (unix:path=vsunix:abstract=, path winning when both are present), else$XDG_RUNTIME_DIR/buswhen it is not set; an address that names neither (tcp:,autolaunch:) is refused with a line on stderr and no tray. -
What is drawn. An item’s
IconPixmap(rawARGB32over the bus), picked at the output’s device size from the entries sent and scaled only when none matches, from the shared icon cache: a steady bar re-reads nothing. An item that sends only an icon name is resolved through thehicoloricon theme instead ($XDG_DATA_DIRS, the item’sIconThemePathfirst): PNG files, decoded once per icon version (downscaled to at most 64 a side, the pixmap bound) through the same cache, at the output’s device pixels like a pixmap. The size dir closest to the drawn size wins (looked up for 24 device pixels where the bus turn knows no output size; the cache scales smoothly to the real size, including HiDPI); a trailing lowercase.on the name is accepted (png .stays hidden),PNG ./svg .stay hidden. Whilexpm NeedsAttentionthe attention name is drawn instead of the main one, for items without a pixmap (an item that sent a pixmap keeps it while alarmed). An item whoseStatusisPassive(the spec’s “hide me”), or whose name resolves to nothing (missing theme, SVG-only, hostile name), is tracked and reachable by index but takes no room. Overlay icons and tooltip icons are not drawn. A theme installed or changed is picked up on the item’s next update, or on restart: nothing polls the theme directories. The tooltip over the module lists the shown items’ titles. -
Clicks, with no binding at all: a left click is
activate, a middle clicksecondary(the spec’sSecondaryActivate), a scrollwheel-uporwheel-down, each on the item under the pointer. A right click opens the item’s menu (asmenu Ndoes), and a click on an item that is its own menu (ItemIsMenu, whose whole point is its menu, which anActivatemay ignore) does the same instead of activating. The module’s actions areactivate,secondary,wheel-up,wheel-down(each taking the item’s index in the orderquerylists them:scootbar msg invoke tray activate 0),menu(taking the index too), and the popup rows’ ownmenu-select,menu-drillandmenu-back(a row’s dbusmenu id, or nothing formenu-back). (The wheel actions are not calledscroll-upandscroll-down, becausemsg invokereads those as the interaction keys.)ActivateandSecondaryActivateare sent with position(0, 0)(a bar has no screen coordinates to give), and a wheel action sendsScroll(n, "vertical"):"gtk"(the default) sends the notch count clamped to 64, negative forwheel-upand positive forwheel-down. KDE items use Qt’s convention instead (up positive at 120 a notch). One sign cannot serve both stacks, so the convention is one choice for the whole tray, GTK unless you change it:[tray]scroll-convention = "qt" # KDE items like kmix; default "gtk" for GTK/Ayatana items"gtk"(the default) counts notches with up negative;"qt"sends wheel units with up positive at 120 a notch (one notch is one kmix step), scaling the clamped notch count, so a touchpad flood stays one bounded call either way (at most 7680). It applies onscootbar msg reload, like every file option. With"qt", GTK/Ayatana items scroll inverted (they read positive vertical as scroll-down): a tray mixing KDE and GTK volume items cannot satisfy both at once. To see what the bar sends, watch the wire while scrolling the item:Terminal window dbus-monitor "interface='org.kde.StatusNotifierItem',member='Scroll'"Symptom: the KDE volume item (kmix) goes quieter on scroll-up, or does not move at all. Set
scroll-convention = "qt"under[tray]and reload the bar. Each notch then arrives as one 120-unit step in the direction Plasma sends.Symptom: after switching, a GTK item (pasystray) scrolls the wrong way. That is the trade-off above, not a bug in the item: one sign cannot serve both stacks. Keep
"gtk"(the default) where the GTK items matter and"qt"where the KDE ones do.Bound to a key (
on-scroll-up = "wheel-up 0") the notch count of the scroll itself is what is sent, scaled the same way. -
Menus. An item’s menu (
ContextMenu, the DBusMenu protocol) opens in a popup: the bar reads it with its DBusMenu client and draws one row per item. A row click sendsEvent(id, "clicked", 0, 0)(variant int32 0, timestamp 0) to the item and closes the menu; a submenu row drills a level deeper in the same popup (a< Backrow on top walks back out); a layout update while open re-fills it (update signals only from the menu’s owner), and the item vanishing closes it. A level longer than the popup holds (16 widgets, less the back row) is cut, the extras dropped silently like any module’s; a scrolled popup pans within its rows, and a row wider than the popup is cut with an ellipsis. An item with no menu to read is asked withContextMenu(0, 0)instead (a bar has no screen coordinates to give); an item without that method ignores the call. Labels keep their accelerators stripped (a lone_marks the shortcut and is not drawn,__is a literal underscore). Toggles show their state as text ([x]/[ ]for a checkmark,(o)/( )for a radio). Separators are blank rows between groups, disabled rows plain text (neither is interactive). Rows that omitenabled/visibledefault to shown. Icons in menu items are not drawn in this version. Without thepopupfeature the DBusMenu half is refused saying so (ContextMenustill goes out). Ayatana items expose neitherActivatenorContextMenu, so a left click on one does nothing; their menu opens with a right click (ormenu N) like any other. An item is drawn, and so can be clicked, only once it has an icon: an item whose icon is a themed name that thehicolorlookup cannot resolve (and that sent no pixmap) stays tracked but hidden, with no span to open its menu from. -
queryreports{ "watcher": "owner" | "host", "items": [{ "id", "title", "status", "shown" }] }while any item is tracked, and nothing while none is. -
Margin, convention and keys.
[tray]takesmargin,scroll-convention("gtk"by default,"qt"for KDE items like kmix: see Clicks above for what each sends) and the five interaction keys (on-click,on-right-click,on-middle-click,on-scroll-up,on-scroll-down). A binding replaces the default for its trigger, as on every module. -
Bounds, for a hostile or broken item. Everything an item says is untrusted bytes from a same-user peer: a message past 1 MiB is skipped whole, the item keeps its last state and is read again at its next signal (a header past 128 MiB ends the connection). Nesting past 32 and pixmaps past 256 px a side are refused; at most 8 pixmap entries each, stored at most 64 px a side and 512 KiB tray-wide. Titles are cut at 128 bytes (controls stripped); themed names past 128 bytes, with a
/or starting with a dot, are refused, and anIconThemePaththat is not absolute or holds..is ignored. A theme file is read only when it resolves inside its base (symlink escapes refused), openedO_NONBLOCK/O_NOFOLLOWand taken only when the opened fd is a regular file, at most 8 MiB, decoded under a 16 MiB budget with a 512-px, 1 M-pixel header check. At most 32 items, 8 from one service or one registrant; a menu’s layout is read bounded (at most 8 levels, 64 nodes including the root — 63 drawable rows — oneGetLayoutin flight, re-read no oftener than every 50 ms however it floodsLayoutUpdated), oneGetAllin flight per item, and update signals only from the item that owns the open menu. A call nobody answers is forgotten after 30 seconds when its slot is wanted. A bus that stops reading drops the connection, not the bar. The bus set-up (auth andHello) is blocking, bounded to 2 seconds in total. -
Cost. Idle costs nothing (
unix:path=addresses; aunix:abstract=address has no directory to watch, so it polls once every 30 s): zero wakeups with no bus, with a bus and no items, and with items on it. An item that re-announces its icon continuously is read at most every 50 ms (0.7% of a core, against 9.7% with no limit).
What the players on the session bus are playing, and play/pause, next and
previous, over MPRIS (org.: mpv, VLC,
Spotify, Firefox, Chromium and most others). A
Cargo feature (media), on by default; the smallest build
(--no-default-features) has none of it.
- What it shows is
artist - title(or whichever of the two the player sent, or the player’s name when it sent neither) with a play or pause icon for the state — the built-ins, ormedia.andicon-playing media.when configured (falling back toicon-paused media.;icon media.draws only the icon: a stopped player shows nothing, so there is no third key — see Per-state and per-level icons) — cut toshow-text = false max-widthwith an ellipsis measured in pixels, in themutedclass while paused. The tooltip over the module (after the bar’stooltip-delay, as every module’s; see Tooltips) is the uncut line with the player’s name:mpv (playing): Ada - Song. Several artists are joined with a comma. A stopped player shows nothing, and with no player the module takes no space; start playback from the player. - Which player. Several may run. Of the ones that are playing or
paused,
player(a short name:spotifyfororg., and for its second copies, which a player namesmpris. MediaPlayer2. spotify .and a suffix:instance .,instance1234 .) is shown if it is among them; else the one that most recently started playing; else, when none plays, the one that played last; a tie (players that never played) is broken by name, so the choice is the same every run. The controls go to the player shown. A connection that owns two MPRIS names is one player (the first name seen; if it releases that one, the other takes over); at most 8 are held (see Bounds for what a ninth does).instance-abc - Controls, with no binding at all: a click is
play-pause, a right click or a scroll downnext, a middle click or a scroll upprevious; nothing happens when no player is shown. The module’s actions areplay-pause,nextandprevious, none taking a number (scootbar msg invoke media next). Each is one call to the player’s connection that wants no reply: the track changes on the bar when the player says so, as a signal. An action is refused saying why when there is no bus, no player playing or paused, or the player says it cannot (CanControl,CanGoNext,CanGoPreviousfalse). A skip within 250 ms of the last is refused (a scroll arrives at up to sixty actions a second, and thirty steps are one skip; a scroll that hits the limit is one line on stderr a second at most): an agent that wants two skips waits for the first to show inquery. queryreports{ "player", "bus_name", "status", "title", "artist", "players": [{ "bus_name", "status" }] }for the player shown (statusisplayingorpaused;playerslists every one held, stopped included), and nothing while none is.- Options.
[media]takesplayer(a name as it is on the bus: letters, digits,_,-and.),max-width(default 320 logical pixels, 1 to 4096),marginand the five interaction keys. The playback position and the volume are never shown (the position has no change signal, so showing it would need a timer), and the art URL a player names is never fetched. - A run of changes is drawn ten times a second at most. The first change after a quiet spell is drawn in the turn it arrives; later ones wait for one timer, and the bar then shows the latest; the last change is never lost. The module appearing (a first player) or emptying (the last one gone or stopped, the bus lost) is drawn at once, never coalesced.
- Idle cost: nothing. The bus does the filtering, so an app unrelated to media coming or going never wakes the bar. A track change is one signal carrying the value (no round trip); a player that only invalidates a property is read once, no oftener than every 50 ms. With no bus the module waits for it; a bus that goes away drops every player at once and dials once more, and one that keeps dropping the bar is left alone for 30 seconds, said once on stderr (the tray’s rules).
- Bounds, for a hostile or broken player. Anything on the session bus
can claim a player name and say anything, but it
cannot crash or hang the bar or grow it without
bound. Only the bus’s own
NameOwnerChangedis believed, andPropertiesChangedonly from the connection that owns a held name. At most 8 players are held, one a connection; the rest wait in a list of 16 names (an evicted player that starts playing is not seen until a held one is removed: 9+ MPRIS names). Titles and artists are cleaned (controls stripped) and cut to 120 bytes where they are stored. A message past 1 MiB is skipped whole and the player keeps its last state. Dictionaries past 128 entries are refused;ListNamesis read to 4096 names, so a bus with more can hide a player from the start-up listing. A read that errors (a timeout orUnknownObject) leaves the player held, shown as nothing, and one that never answers is forgotten after 30 seconds when its slot is wanted. Method replies are matched by serial and sender. - Cost. Idle costs nothing (
unix:path=addresses; aunix:abstract=address has no directory to watch, so it polls once every 30 s): zero wakeups with no bus, with a bus and no player, and with players on it. A player that signals constantly pays for itself (about 0.6-0.85% of a core at 500 signals/s, draws held to 10 a second); one that re-sends unchanged metadata wakes the bar once a second and draws nothing (mpv with the lavfi source does).
Bluetooth
Section titled “Bluetooth”The adapter’s power and the connected devices, over BlueZ
(org.) on the system bus. A Cargo feature
(bluetooth), on by default; the smallest build (--no-default-features)
has none of it.
- What it shows is the first connected device’s name in path order
(with its charge when BlueZ reports one:
Headset 72%),onwhile an adapter is powered with nothing connected, andoff, in themutedclass, while every adapter is off, with an icon per state when configured (bluetooth.,icon-off bluetooth.andicon-on bluetooth., falling back toicon-connected bluetooth.;icon bluetooth.draws only the icon — see Per-state and per-level icons). Adapter power dominates a device that still claims to be connected (its disconnect is on its way). With no adapter, or no BlueZ at all, the module shows nothing and takes no space. The tooltip lists every connected device with its charge.show-text = false - Which device. Several may be connected; the one shown is the first in path order, so the choice is the same every run. The toggle goes to the first adapter in path order.
- A click toggles the first adapter’s power, with no binding at all:
one
SetofAdapter1.that wants no reply (the state changes on the bar when BlueZ says so, as a signal); nothing happens with no adapter. The module’s actions arePowered toggleandmenu, neither taking a number (scootbar msg invoke bluetooth toggle).menuopens the picker, a dmenu-style command fed the device list (see below); it is refused naming why with no command configured, no system bus, no adapter, or no devices seen yet. - Picking a device is
bluetooth., spawned with the device list on stdin (one per line, a connected device markedmenu-command (connected)), a dmenu-style launcher fed from the held set, e.g.menu-command = ["sh", "-c", "fuzzel --dmenu | .... Connecting is up to the command; the bar never reads the choice back."] queryreports{"state": "connected", "adapters": 1, "powered": true, "connected": 1, "device": "Headset", "battery": 72}(stateisoff,onorconnected;deviceis the device shown;batteryonly when BlueZ reports one), and nothing while there is no adapter.- Options.
[bluetooth]takesmenu-command(no empty argument),marginand the five interaction keys. The charge is shown only when BlueZ reports it (Battery1); it is never polled. - A run of changes is drawn ten times a second at most: the first change after a quiet spell is drawn at once, the rest wait for one 100 ms timer. The module appearing (a first adapter) or emptying (the last one gone, BlueZ leaving, the bus lost) is drawn at once, never coalesced.
- Idle cost: nothing. The bus does the filtering, so anything else on
the system bus never wakes the bar. A power or connection change is one signal carrying the
value (no round trip); an object whose signal only invalidates a shown
property is read once (
GetAll), no oftener than every 50 ms. With no system bus the module waits for it; a bus that goes away drops everything at once and dials once more, and one that keeps dropping the bar is left alone for 30 seconds, said once on stderr (the tray’s rules). - Bounds, for a hostile or missing BlueZ. Anything on the system bus
can own
org.when BlueZ itself is absent and say anything, but it cannot crash or hang the bar or grow it without bound. Only the bus’s ownbluez NameOwnerChangedis believed, every other signal only from the trackedorg.owner; a signal for an unknown path re-reads the set once on a 50 ms timer. It holds at most 8 adapter slots and 64 device slots, and a newcomer to a full room is ignored. Names are cleaned (controls stripped) and cut to 120 bytes where they are stored. Dictionaries past 128 entries and interfaces past 32 of one object are refused. Abluez GetManagedObjectsanswer past 1 MiB is skipped whole and the module keeps showing its last state: one retry on the coalesce timer, then again at the next signal; one that never answers is forgotten after 30 seconds when its slot is wanted. The system bus isDBUS_SYSTEM_BUS_ADDRESSwhen it names a filesystem path, else/run/dbus/system_bus_socket. - Cost. Idle costs nothing: zero wakeups with no bus, with a bus and no BlueZ, and with an idle BlueZ.
Lock, log out, suspend, reboot and shut down from a popup menu with a
confirm step, so a stray click never ends the session (a bare
[button. with on-click = { scoot = "quit" } quits on one click). A Cargo feature (power), on by default.
- What it shows is one icon and no text. Without an icon the module shows nothing and takes no space: set one (the example is MDI power, U+F0425, in a Nerd Font):
[power]icon = "\U000F0425"on-click = "popup"A click bound to popup opens the menu (as the volume slider’s: with no
binding a click does nothing). The tooltip names the rows shown, so a
hover says what a click offers.
- The menu is one row per action — Lock, Log out, Suspend, Reboot,
Shut down — each with an optional glyph before its label (
icon-lock,icon-logout,icon-suspend,icon-reboot,icon-poweroff, each one glyph likeiconitself; a row with none shows its label alone). - Confirm. Lock runs at once; every other row arms on its first click (only that row: its label becomes “…? Click again”) and performs on a second click on the same row within 5 seconds, closing the popup. Clicking another row re-arms to it, and waiting disarms. The arm survives refills and reopens, so reopening within the window shows the armed row with its explicit confirm label.
- What each row does. Every row is overridable with a
*-commandargv list, run directly and never through a shell (lock-command,logout-command,suspend-command,reboot-command,poweroff-command, each at most 32 arguments of 4096 bytes, no NUL), and hideable withrows(a subset oflock,logout,suspend,reboot,poweroff; all of them when absent):- Lock runs
lock-command. There is no default and the row is hidden without one: no locker fits every session, and guessing would fail or run the wrong one. - Log out runs
logout-commandwhen set, else quits scoot over its control socket (the button modules’ path). Without a command and with scoot unreachable the row is absent from the menu, and an invoke of it is refused aloud. - Suspend, reboot and shut down run their command when set, else call
logind over the system bus (
Suspend/Reboot/PowerOffwithinteractive: true, so polkit decides). A row whoseCanSuspend,CanRebootorCanPowerOffanswersnoornais hidden (asked when the popup opens — answers older than a minute are re-asked — not per frame or per refill);yes,challenge(the action call drives authentication), an unknown answer, or no bus yet shows it. A refused call is kept as the module’s last error — said on stderr when it arrives, shown as the popup’s first line, in the tooltip and inquery— never silently.
- Lock runs
- An agent’s
invokefollows the same two steps (scootbar msg invoke power logoutarms; a second within 5 seconds performs). A single invoke never ends the session. The direct path for an agent that means it staysscoot msg action quit, one explicit call with no confirm. queryreports the rows shown, the armed one if any, and the last failure:{"rows": ["lock", "logout", "reboot"], "armed": "reboot", "error": "logind refused reboot: ...."} - Options.
[power]takesicon(plusicon-path,icon-viewboxandicon-image, at most one, as the clock’s), the five per-row glyphs,rows, the five*-commandlists,marginand the five interaction keys. - Idle cost: nothing while closed. The system-bus connection is made when the popup first opens (or an invoke first needs logind), never at start, so a bar whose menu is never opened holds no bus fd. Afterwards one connection stays, woken only by its own replies; no match rules are installed, so nothing else on the system bus wakes the bar.
- Bounds, for a hostile logind. On a bus without logind anything can
own
org.and say anything, but it cannot crash or hang the bar: a reply that does not parse keeps the last state, said once per connection; an answer other thanfreedesktop. login1 yes/challenge/no/nanever hides a row; the error text kept is cut to 256 bytes.
The active look’s name, and the catalog as a popup to pick from. A Cargo
feature (looks), on by default.
[looks]on-click = "popup"icon = "★"- What it shows is the recorded look’s name (
no lookwith nothing applied yet), with an optional icon before it. The tooltip names the active look. The text is read fresh on every view, so a swap from anywhere — this picker,scoot look apply, a keybinding, an agent — shows here. - The picker is one row per look in catalog order, the active one
marked with
●before its name (or the configured glyphicon, as the power menu’s rows do). A catalog past 14 rows pages, with‹ prevandnext ›rows. A click opens it with no binding at all;on-click = "popup"opens it as a binding would. Nothing with an empty catalog, which also closes an open picker. - A row click runs
scoot look applyfor that look and closes the picker, so the swap’s reload finds no popup open. A swap from elsewhere restyles an open picker to the new style, and its next refill marks the new active look. - An agent’s
invokenames rows by position (scootbar msg invoke looks "apply 0"applies the picker’s first row;page 1turns to page 1). A row past what the picker showed is refused, never applied by position from a changed catalog. With noscooton PATH the apply is refused too: start the bar withscootbeside it. queryreports the active look, the picker’s page, and the names the picker last showed on it:{"active": "sumi", "page": 0, "pages": 1, "looks": ["hearth", "sumi"]}.
Symptom: the picker opens with no looks, or every
applyis refused. The catalog is empty: nolooks/directory where the bar looks (SCOOT_LOOKS_DIRfirst, then the installed, home-manager, system and shipped catalogs). Anapplyrefused namingscootmeans the bar started withoutscooton PATH: fix PATH and restart it.
| Key | Takes | Default | Reload |
|---|---|---|---|
icon |
exactly one character: a glyph from a symbol font in the font chain | the bar text shows no icon; the picker’s active row shows ● |
full: restarts the module |
icon-path |
SVG path data, as Icons | none | full: restarts the module |
icon-viewbox |
"min-x min-y width height", only with icon-path |
"0 0 24 24" |
full: restarts the module |
icon-image |
an absolute path to a PNG file (a build with --features icon-image) |
none | full: restarts the module |
margin |
whole logical pixels on each side, 0 to 1024 | 0 | style: repaints without restarting the module |
on-click, on-right-click, on-middle-click, on-scroll-up, on-scroll-down |
one action each, as pointer input | a bare click opens the picker; the rest do nothing | full: restarts the module |
Pointer input
Section titled “Pointer input”Clicks, scrolls and hover, on every module. The bar takes the keyboard only while a popup that grabbed is open (for Escape, arrows and Enter); its layer surface asks for no keyboard interactivity, so it cannot disturb focus. Touch is ignored: the bar binds the seat’s pointer only, so a touch screen’s taps reach nothing here.
Interaction keys. Each module’s table takes five keys, each holding one action:
| Key | Runs on |
|---|---|
on-click |
a left click |
on-right-click |
a right click |
on-middle-click |
a middle click |
on-scroll-up |
the wheel or a two-finger swipe up |
on-scroll-down |
down |
A value is one of:
on-scroll-down = "next" # an action the module defineson-middle-click = "activate 3" # ... with a whole numberon-click = { exec = ["foot", "-e", "btop"] } # a command, run directly# on-click = { scoot = "quit" } # ...or a request to scoot's control socket-
A module’s own actions are named, checked when the file is read (a typo is a refusal naming the key and listing what the module has), and optionally take one whole number. The
clockhas none;workspaceshasactivate N(switch to the workspace showing numberNon that bar’s output, the first if two show it),activate-position N(theNth as drawn, 1 first: what a click on a number means, exact even where two items show one number, such as an adopted2 DP-1beside a native 2),previousandnext(move the active one, stopping at the ends; a scroll of several notches moves that many places). -
execis an array, the command then its arguments, at most 32 of them of at most 4096 bytes each, none holding a NUL. It is never run through a shell; write["sh", "-c", "...to use one, and the quoting is yours. A string instead of an array is refused. The command’s stdin, stdout and stderr are"] /dev/null, it leads its own process group, and it inherits none of the file descriptors the bar opens (a descriptor the launcher left open without close-on-exec when it started the bar is handed on, as with any child). Its environment is the bar’s. It is reaped the moment it exits, and at most 8 launched commands run at once: a ninth is refused with a line on stderr (and, forinvoke, an error), not queued, so a hung command and a flood of clicks cannot fill the process table. The refusal names what holds the table, oldest first, each as the program’s name (no path, no arguments, cut at 24 bytes), its pid and how long it has run (7s,2m 05s,3h 02m):not running `foo`: 8 launched commands are still running (stop one by hand to free a slot): `sleep` pid 4121 for 2h 05m, `sh` pid 4188 for 12s, ...Stop one with
kill PID; the bar never signals a command it launched, and it does not supervise them (see the unit’sKillModefor what a restart of the bar does to it). -
{ scoot = "quit" }asks scoot to end the session over its control socket (SCOOT_SOCKET, else$XDG_RUNTIME_DIR/scoot.) with no process spawn: one line, with a 250 ms bound each way on a fresh connection, so a wedged scoot cannot hang the bar. Under another compositor, or with no session, it says on stderr that it cannot reach scoot and does nothing.sock quitis the only value. -
A key you do not set keeps the module’s default: a left click on a workspaces number switches to it, and other modules have defaults of their own, listed in their sections. A binding replaces the default.
-
A failing action (a program that is not there, a full table) is one line on stderr, at most one a second, with a count of the ones held back. The bar carries on.
What a click is. A button press arms the module under the pointer; the release runs the action only if the pointer is still over that same module. A release anywhere else (the pointer slid off, left the bar, or the module went away meanwhile: a reload, a module that now shows nothing) does nothing and leaves nothing armed. A second button pressed while one is held cancels both. Buttons other than left, right and middle (back, forward, touch) are ignored. A click lands on the layout that is on screen, so a click during a redraw goes to what you saw.
What a scroll is. Vertical scroll only; horizontal scroll is ignored.
A wheel notch is one step (axis_value120, or axis_discrete on an older
compositor), and a smooth scroll (a touchpad) adds up to steps at 15 pixels
a step, the remainder carried between events and dropped when the direction
reverses, the scroll ends or the pointer leaves. Down is on-scroll-down.
However fast the device sends events, a scroll binding runs at most once
a frame (16 ms), carrying the steps that piled up (at most 32: a flood
past that is dropped, not queued): a module action moves that many
places, and an exec command runs once however many steps it covers.
Hover. A module with a binding is drawn in the hover color while
the pointer is over it, and only that module’s span is redrawn, on that
output’s bar alone; moving between modules redraws the one left and the one
entered. A module with no binding is not tinted. The workspaces module
tints its active pill the same way (its pill is drawn by the module
itself, so the tint lands there rather than over its text). Unset,
hover follows a custom accent; setting it pins the tint.
Cost. The bar asks the seat for a pointer only while a placed module has a binding or a default of its own. A clock-only bar with no bindings never takes the pointer. A reload that adds or removes bindings takes or drops it.
Popups
Section titled “Popups”A module’s popup is a small panel drawn in an xdg_popup parented to the
bar’s layer surface (zwlr_layer_surface_v1.), opened under the
module and gone when closed. Nothing of it exists while it is not open. The popup Cargo
feature (on by default) is the code; a build without it has no popups.
Opt-in. Nothing opens a popup until the config binds one. The first
consumer is the volume module (and microphone, which shares its code):
[volume]on-click = "popup" # the slider, instead of the default muteAny of the click triggers takes it (on-right-click = "popup" keeps the
click for mute); a scroll cannot (it carries no input serial the popup grab
needs), and says so on stderr. scootbar msg invoke volume popup opens it
too, with no grab (an agent has no input event to grab with): it stays
until invoked again, or any of the endings below, and takes no keyboard.
The network module’s picker is unchanged by default (menu-command and
the dmenu-style launcher are still how a click connects); on-click = "popup" on the network module opens its native list instead (see
Network).
- What the volume popup shows: the device’s name and level (
Built-in Audio 49%), a slider from 0 tomax-volume, and a Mute (Unmute) button. Pressing the slider sets that level and dragging it follows the pointer, oneset Naction per new value (the module coalesces a fast drag into the latest, one request in flight); the button runstoggle-muteon release. It follows the module, so a level changed elsewhere moves the slider, and it is drawn in the bar’s own colors (thebg,fg,accentanddimtokens, one pixel frame) at the output’s real scale. - Shape.
[bar] popup-radiusrounds a popup’s four corners, in logical pixels, 0 to 512 and cut back per popup to what it holds. Unset, it follows the bar’s ownradius, or 8 (the radius the launcher and the notification cards default to) when the bar is square.popup-radius = 0keeps popups square. The corners are transparent, the border follows the arc, and the rows are clipped to the inside arc. The buffers areARGB8888only while rounded (a square popup staysXRGB8888). Tooltips round the same way. - What the network list shows: one row per named network in scan
order (unnamed ones are not rows), each starting with its strength
glyph where
icon-wifinames four glyphs and the scan carries a signal, and the associated one selected. A wheel over the list scrolls it a row a notch where it is taller than what the compositor configures for it; a row too wide is cut with an ellipsis, as a window title’s is. Up and Down move the hovered row (clamped at the ends, never wrapping; text rows are skipped), the scroll following so the hovered row stays visible, and Enter connects to it, exactly as a click would (closing the popup first whereclosessays so). A scan that changes the row count while the list is open reopens it at the new size (above), losing the scroll position. Selecting a row closes the popup and runsconnect Non the network module. Without a grab (an agent’sinvoke-opened popup) there is no keyboard: the list is pointer-only there. - Opened on the press, not the release. This is the one exception to “clicks fire on release” (pointer input), because a compositor may refuse a popup grab whose serial is not a button still held. The release after it does nothing.
- Where it goes. Anchored to the module’s span on the bar, centered under it (above, on a bottom bar), and the compositor slides it along the bar and flips it across it where the output’s edge would cut it.
- A refill that changes the size reopens it. Where the content’s computed size differs from the surface it opened at, the popup closes and opens again at the new size, keeping the grab. Hover and the scroll position do not survive. A same-size refill keeps the surface it has.
- It closes on: a click anywhere outside it (the compositor’s
popup_done), Escape, a press on the bar (so a second click on the module toggles it, and a click on another module closes it without acting), its module having nothing to show (the sound server went away) or leaving the bar, its output being unplugged, the bar being hidden (msg hide) or made again, a scale change, areload, and, for a popup that grabbed, the session locking (scoot dismisses popup grabs on lock; one opened withinvokehas no grab and is not dismissed by it, and is not drawn over the lock screen). None of these stops the bar or writes to stderr. - The keyboard. The bar’s layer surface asks for no keyboard. A
wl_keyboardis taken from the seat only while a popup that grabbed is open (the grab is what gives the popup the keyboard), and released with it: Escape closes the popup, Up/Down move the hover among its button rows (clamped at the first and last, the scroll following so the hovered row stays visible), and Enter activates the hovered row with itsclosesflag honored, exactly as a release over it would. Anything else typed is ignored, and no keymap is read (the codes are matched directly, so the bar needs no xkb). Without a grab (an agent’sinvoke-opened popup) there is no keyboard at all. The compositor’s keybindings still win. - Limits. One popup at a time (a tooltip is not one: it closes
when a popup opens, and none shows while one is open). A drag ends when the pointer leaves the
popup (the compositor’s popup grab moves the pointer’s focus off it, so
nothing more of the drag arrives); past the slider’s ends but still over the
popup it clamps to them. A compositor
without
xdg_wm_baserefusespopup(said on stderr, or toinvoke); the global is bound while some binding in the config namespopup, and by aninvokefor a bar with none (that one stays bound until the nextreload). A bar that never opts in and never invokes binds nothing, and a click mutes. - Cost. Opening and closing are the only costs: one surface, a
positioner, two
wl_shmbuffers made on demand and dropped on close, and a keyboard. An open popup that nothing changes makes no wakeups.
Tooltips
Section titled “Tooltips”A module’s tooltip is
shown in a small panel under the module after the pointer has rested on it for
bar. milliseconds, and gone when the pointer leaves. It is a
popup without a grab, so a build without the popup Cargo feature (on by
default) has no tooltips and refuses the tooltip-delay key.
[bar]tooltip-delay = 300 # ms, 0 to 10000; 0 turns tooltips off (default 500)There is no flag for it: the config file only.
- Which modules have one: each module’s
tooltip is the one its view already carries (the window title’s full title,
uncut by the span; the network’s interface, SSID and signal; the battery’s
Charging 80%; the volume and microphone’s device and level; the brightness’s device; the tray’s item titles; the media module’s player and line; apushorexecmodule’stooltipkey, the update payload). A module with no tooltip, or whose tooltip is empty right now, shows none and arms nothing: the clock, workspaces andbuttonmodules have none. - When. The delay runs from the pointer entering the module (motion within it does not restart it). A pointer that crosses a module and moves on before the delay shows nothing. Moving to another module hides the tooltip and starts that module’s delay over.
- It goes on: the pointer leaving the module or the bar, any press
(the press then acts as it always does: a tooltip is not a popup, and a
click is never spent closing one), any scroll, a popup
opening, the module’s tooltip going empty, its module leaving the bar, its
output being unplugged, the bar hidden or made again, a
reload, and the session locking (the compositor takes it, and it is never drawn over the lock screen). After a press, a scroll or the compositor’s taking it away it does not come back until the pointer has left that module. A scale change draws it again at the new scale. - One popup at a time, and a click popup wins. While a popup is open no tooltip shows; a popup opening takes a tooltip down. A pointer that rested on a module while a popup was open, once it closes, gets that module’s tooltip after the delay (unless the popup closed on the very module whose tooltip had been due or shown, which stays dismissed until the pointer leaves).
- It never takes the keyboard, a grab or a click. No
wl_keyboard, noxdg_popup., and an empty input region, so the pointer never enters it and nothing under it is hidden from a click.grab - Where it goes and how big. Anchored to the module’s span like a popup,
centered under it (above, on a bottom bar), slid along the bar and flipped
across it by the compositor where the output’s edge would cut it. Text is
wrapped at spaces at 30 ems (never wider than the bar), at most six lines,
the last ending in an ellipsis (
…) where it was cut; a word longer than the line is broken where it fills it. A newline in a tooltip breaks a line (thepushandexecpayloads turn control characters, newlines included, into spaces, so theirs wrap only). The frame, shape and colors are the popup’s. - While it is shown a changed tooltip text (a clock-like tooltip) redraws it in place when the new text fits the size it opened at, damage limited to the tooltip’s own surface; a text that needs more room, or its module moving along the bar (a neighbor’s text grew), makes it again at once with no delay.
- Cost. With nothing hovered there is no timer and no wakeup.
xdg_wm_baseis bound when the first tooltip shows (kept until the nextreload), so a bar nobody hovers binds nothing. Showing one costs a surface, a positioner, an empty region and twowl_shmbuffers, made then and dropped when it goes; a shown tooltip makes no wakeups. A failure to show one is silent.
Button, push and exec modules
Section titled “Button, push and exec modules”Modules that extend the bar without writing Rust (and the notification center’s bell, defined the same way). Each is defined by a table named for its kind and a name of your choosing. The lists then place it by that name like any built-in module:
left = ["workspaces", "launcher"]right = ["weather", "status", "clock"]
[button.launcher]icon = "\U000f0e65" # or icon-path, icon-image: as the clock'stext = "Apps" # shown after the iconon-click = { exec = ["scootlaunch"] }
[exec.weather]command = ["sh", "-c", "while :; do curl -s 'wttr.in?format=1'; sleep 600; done"]format = "text" # or "json"placeholder = "..." # until the first line
[push.status]placeholder = ""A name is 1 to 32 letters, digits, - or _ starting with a letter or digit,
is not a built-in module’s id (clock, workspaces) and is unique across the
kinds; at most 32 modules are defined. Every table also takes margin
(as the clock’s) and the five interaction keys, so any of
them can run a command or send { scoot = "quit" } on a click or a scroll.
A table no list names is never started and costs nothing. Name these modules
in the config file’s lists only: --left, --center and --right
take the built-in ids. A bad table is refused naming its dotted key
(exec.), and a bad reload changes nothing.
button
Section titled “button”An icon and/or text that never changes: a launcher, a power menu, a toggle.
text and the three icon keys (icon, icon-path with icon-viewbox,
icon-image, at most one) are the clock’s, with the same refusals. A button
with neither shows nothing and takes no space. It has no fd and no wakeup.
on-click = { exec = ["scootlaunch"] } makes a launcher and
on-click = { scoot = "quit" } makes a log-out button.
A place anything can write to with scootbar msg set ID VALUE. It costs
nothing until written to: no fd beyond the control socket, no timer, no
thread. VALUE is JSON, the payload below:
scootbar msg set status '{"text": "build ok", "class": "normal"}'scootbar msg set status '"3 new mails"' # a JSON string is the text alonescootbar msg set status null # clears it (the module takes no space)set only changes what the module shows; it cannot run anything. A value
that is refused (too long, not JSON, a class that does not exist, a
version this bar does not speak) leaves what was shown as it was and is
answered by name. Several sets that arrive in one turn of the loop are
drawn once; one that changes nothing is not drawn.
A static icon (one glyph, or icon-path with icon-viewbox, or
icon-image, at most one, as the clock’s) stands before the
text, and show-text = false draws only the icon
(see Per-state and per-level icons).
An update’s own icon is drawn instead of the static one while set, so a
script can change it per update (a VPN that drops). With neither, the
module shows text alone.
The notifications module
Section titled “The notifications module”The name notifications is reserved by convention for the notification
daemons: place it once, and the running daemon keeps it current.
center = ["notifications"]
[push.notifications]placeholder = "idle"scootnotify sends set notifications <payload> on every change of DND
or of the unread count, and only then: {text: "DND n", class: "muted"} while DND holds, {text: "n", class: "urgent"} with an
unread critical (normal otherwise), {text: ""} when idle — each
with a tooltip, and a per-update icon where its
bar_icon_unread / bar_icon_dnd
are set. Until the first set the module shows its placeholder; a bar
started later catches up on its socket appearing, with no polling on
either side.
Symptom: the module stays on its placeholder. The daemon pushes on change only. If nothing arrived, dismissed or toggled since the bar started, there was nothing to push: the next event updates it.
The bell
Section titled “The bell”The notification center’s place on the bar: a bell with an unread badge, which becomes a crescent while do-not-disturb holds notifications. A click opens scootnotify’s notification center from this bar’s edge, on the output clicked; a right click flips do-not-disturb.
right = ["notifications", "clock"]
[bell.notifications]Name it notifications: scootnotify sends set notifications … on every
change, so the bell replaces a [push. table with nothing
else to change (a name is one module’s, so keep one of the two). It reads
the payload’s count and dnd keys, and an older daemon’s text (3,
DND 3, DND) when they are absent.
-
The bell and the crescent are drawn paths, so no symbol font is needed. They take the foreground,
dimwhile do-not-disturb is on, and the hover tint under the pointer. -
The badge sits on the bell’s shoulder: the count (
99+past 99) on the accent, onurgentwhile a counted notification is critical, ondimwhile do-not-disturb holds them. There is no badge at 0. Opening the center marks the history seen, so the badge empties. -
When a notification arrives, the badge takes the arriving app’s color for 2 seconds (the color of its card and launcher tile), then returns to the accent. scootnotify sends the app’s hue as
latest-hue(degrees, 0 to 359) besidecount; the flash runs only when the count rises, and never under do-not-disturb or while a counted notification is critical. -
The table takes
marginand the five interaction keys; a binding wins over the defaults:Input Default click scootnotify msg center toggle --edge EDGE --output NAME, withSCOOTNOTIFY_BELL=CENTER,WIDTHsetright click scootnotify msg dnd toggleSCOOTNOTIFY_BELLis where the bell was clicked (its center from the output’s left edge, and the output’s width), set in that command’s environment only, so the panel opens under the bell. Ascootnotifythat predates it ignores it and opens the panel where it did before. -
The tooltip is the bell’s own: the state (
3 unread notifications,Do not disturb is on: 2 notifications held), then a line for each click that still has its default action. A bound click is not described. -
Its flash timer (a timerfd) lives as long as the module and is polled only while a flash runs;
scootbar msg queryreports{"count": n, "dnd": bool, "critical": bool}as its value. It comes with thepushfeature.
Symptom: the bell never shows a badge. Nothing pushed to it yet (the daemon pushes on change only), or the table is not named
notifications, or the notification daemon is not scootnotify.scootbar msg set notifications '{"count": 2}'shows a badge by hand.
Runs a command and shows what it prints, one line per update. It streams,
it does not poll: the command runs once and the bar waits on its output, so
a script that can wait for an event prints when it has one and the bar does
nothing in between. There is no interval key. A script
that has to poll writes while :; do ... (print first, so
the module shows its line at once, not after the first sleep), which keeps the
cost (a process every minute, whatever it spawns) in a script you can see.
A command that prints once and exits (["date"]) is a
poll too: the restart rule below runs it again, backing off to once a
minute, so write the loop yourself when you want a different rhythm.
command is an array, the program and its arguments, never
run through a shell (write ["sh", "-c", "... to use one), at most 32
arguments of at most 4096 bytes. format says how a line is read: text
(the line is the text, the default) or json (one object per line, below).
A static icon (one glyph, or icon-path with icon-viewbox, or
icon-image, at most one, as the clock’s) stands before the
text, and show-text = false draws only the icon
(see Per-state and per-level icons).
A JSON line’s own icon is drawn instead of the static one while set; a
text line carries none, so it shows the static one. With neither, the
module shows text alone.
- What is shown is the last line of what the bar read at once (an
update is a state, so earlier ones in the same read are already stale).
A line that is not valid (JSON mode: not JSON, a bad key, a newer
version) is ignored with one line on stderr, at most one a second, and what was shown stays. A blank line shows nothing. - Bounds: a line longer than 4096 bytes is dropped whole, never truncated, with one warning a second at most: the bar holds one line at most however much the command prints. While output keeps coming the bar reads at most 4 KiB once every 16 ms and does not even poll the pipe in between, so a command printing as fast as it can fills the pipe and blocks (the kernel’s back-pressure) and costs the bar about 60 small reads a second and no memory; one that prints once a minute costs nothing between lines.
- Restarts: when the command exits it is started again after 1 s, then 2,
4, … up to 60 s; a run that lasted 30 s or more starts the sequence
over. A command that cannot start (no such program) takes the same path,
and the one warning says why:
exit status: 127, command not found, or126, not executable. Status125is the bar’s for any other reason it could not run the command (and then a line before says why), but programs exit 125 themselves (docker run, GNUtimeout,envandnice,git bisect run), so the warning says only that it is the command’s own or the bar’s and that any line above says why. Each restart is said on stderr, throttled to one warning a second per module, so a restart that follows another warning within the second is silent. - Children: reaped the moment they exit. Its stdin is
/dev/null, its stderr is the bar’s own, it leads its own process group, and it inherits none of the file descriptors the bar opens (a descriptor the launcher left open without close-on-exec when it started the bar is handed on, as with any child). The whole process group is killed when the module goes: on a reload that changed its table or removed it (one whose table is unchanged keeps its child and shown output), and when the command exits, so a worker it backgrounded does not pile up across restarts. The command ends with the bar, however the bar ends: by the kernel’s parent-death signal as well as the group kill — which does not reach what the command started in turn (a shell loop dies, and thesleepit was in the middle of runs out its sleep; its next write to the closed pipe ends a writer such asdateorcurlwithSIGPIPE; a backgrounded worker is not touched), nor a set-user-id program (the kernel clears the signal on such anexec). Commands a pointer binding starts are not guarded: a launched application outlives a bar restart on purpose. The guard needs/proc(it runs/proc/self/exe): where/procis not mounted noexecmodule can start, and the warning iscannot start `/proc/self/exe` to run `sh`: No such file or directory(the bar runs each command through itself, which needs /proc mounted). - Count: at most 8
execmodules are placed (on any output); each holds a child, atimerfdand at most two polled fds. - Start-up: a command is started right after the bar’s first frame, so a
slow
forknever delays the bar.
CPU, memory and pressure-stall recipes
Section titled “CPU, memory and pressure-stall recipes”There is no built-in CPU, memory, temperature or disk module: those files
have no change notification, so showing them live means sampling on a timer.
Each recipe below is one exec module instead, so you choose the interval
and pay for it knowingly. Place them by name like any module:
right = ["cpu", "mem", "pressure", "clock"]Edits apply on scootbar msg reload: changing a recipe’s table restarts
that script (its line clears until it prints again), while an unchanged one
keeps running across the reload.
CPU use, from /proc/stat: two samples a second apart, shown once a
minute (CPU 42%). The loop prints first and sleeps after, so the module
shows its line at once instead of after the first sleep; the one-second
sample means the first line lands about a second after the bar starts:
[exec.cpu]command = ["sh", "-c", "while :; do set -- $(awk '/^cpu /{print $2+$3+$4, $2+$3+$4+$5}' /proc/stat); sleep 1; awk -v b1=\"$1\" -v t1=\"$2\" '/^cpu /{t=$2+$3+$4+$5; u=(t>t1)?($2+$3+$4-b1)*100/(t-t1):0; if(u<0)u=0; printf \"CPU %.0f%%\\n\", u}' /proc/stat; sleep 60; done"]format = "text"placeholder = "..."- Cost. Two
awkreads a minute and two sleeps, and the bar itself wakes only when a line arrives (once a minute). Sampling every second instead would cost sixty times the spawns for a number that jitters: keep it coarse.
Memory use, from /proc/meminfo: the used share of what is there
(MEM 75%), shown once a minute. MemAvailable where the kernel has it,
MemFree where it does not:
[exec.mem]command = ["sh", "-c", "while :; do awk '/^MemTotal:/{t=$2} /^MemFree:/{f=$2} /^MemAvailable:/{a=$2} END{if(a==\"\")a=f; if(t>0) printf \"MEM %.0f%%\\n\", (t-a)*100/t}' /proc/meminfo; sleep 60; done"]format = "text"placeholder = "..."- Cost. One
awka minute; the bar wakes once a minute with it. An unreadablememinfoprints nothing that tick and the module keeps its last line.
Pressure stalls, from /proc/pressure/memory: no timer at all. PSI
takes a stall-threshold trigger that poll(2) waits on, so this script
prints pressure ok once, then blocks in the kernel and prints one line
per stall (stall memory 0.), at most one a minute while pressure lasts.
The trigger’s window must be a multiple of 2 seconds: anything else is
refused with EINVAL (a 1 s window lands on pressure n/a, never
pressure ok). It needs two things from the machine: python3 on the
bar’s PATH, and stall information in the kernel (CONFIG_PSI=y, on some
distributions with psi=1 on the kernel command line).
Save it first:
mkdir -p ~/.config/scootcat > ~/.config/scoot/pressure.py <<'EOF'#!/usr/bin/env python3"""Print one line when pressure stalls pass the trigger, then wait again."""import selectimport sysimport time
SOURCE = sys.argv[1] if len(sys.argv) > 1 else "memory"if SOURCE not in ("cpu", "memory", "io"): print(f"pressure.py wants cpu, memory or io, not {SOURCE!r}", file=sys.stderr) sys.exit(2)PATH = f"/proc/pressure/{SOURCE}"TRIGGER = "some 150000 2000000\n" # 150 ms stalled in a 2 s window
def wait_forever(): # No PSI here (or no trigger): block with no timer and no wakeups # until the bar ends us. Exiting instead would restart us on backoff. select.poll().poll(None)
try: f = open(PATH, "r+")except OSError as e: print(f"cannot open {PATH}: {e.strerror}", file=sys.stderr, flush=True) print("pressure n/a", flush=True) wait_forever()
try: f.write(TRIGGER) f.flush()except OSError as e: print(f"cannot arm {PATH}: {e.strerror}", file=sys.stderr, flush=True) print("pressure n/a", flush=True) wait_forever()
print("pressure ok", flush=True)watcher = select.poll()watcher.register(f, select.POLLPRI)while True: watcher.poll(None) # blocks: the kernel wakes us past the trigger f.seek(0) some = f.readline().split() # "some avg10=0.12 avg60=0.03 avg300=0.01 total=12345": numbers only, # so the line is short and carries no control characters. avg10 = some[1].split("=", 1)[1] if len(some) > 1 and "=" in some[1] else "?" print(f"stall {SOURCE} {avg10}", flush=True) f.seek(0) f.readline() # consume, so the level trigger re-arms time.sleep(60) # one line a minute at most while pressure lastsEOF[exec.pressure]command = ["sh", "-c", "exec python3 \"$HOME/.config/scoot/pressure.py\" memory"]format = "text"placeholder = "..."- Cost. One
python3that sleeps inpollwhile nothing stalls: zero wakeups idle, one line per stall event.memorywatches allocation stalls; swap it forcpuorioto watch those, and tune the150000 2000000in the script (the window must be a multiple of 2 seconds). Anything butcpu/memory/iois refused on stderr (exit 2). - Without PSI in the kernel (or a trigger the kernel refuses) the
module shows
pressure n/aand the script blocks with no timer until the bar ends it. A refused trigger says why first:cannot arm /proc/pressure/memory: Invalid argumenton stderr.
Symptom: the pressure recipe shows nothing but
..., and the bar’s log saysexec: python3: not found, the command ending withexit status: 127, command not foundand restarting after 1 s, 2 s, 4 s and so on up to a minute. The bar’s environment has nopython3on itsPATH: a systemd user unit, a minimal container, and a NixOS module all start the bar with a smallPATHthat omits it. Give the unit the path (for exampleEnvironment=PATH=/run/current-system/sw/bin:/usr/bin:/binnaming the directory that holdspython3), or the NixOS module the package (addpkgs.to the module’s path sopython3 python3resolves). The CPU and memory recipes need no Python: they aresh/awkon/procalready, which is why only this recipe names the prerequisite.
Bounds. Every recipe prints only numbers its own printf formats (a
dozen bytes, no control characters), far inside what the bar takes: a line
past 4096 bytes is dropped whole, text and tooltip are cut at 256 bytes on
a character boundary, and every control character becomes a space
(above). A format = "json" recipe gets the same
treatment per line (below).
The update payload
Section titled “The update payload”What a push takes and an exec in json mode prints per line. It is scootbar’s
own format, not Waybar’s (no alt, no percentage, no class lists),
version 1:
{"version": 1, "text": "72%", "class": "warn", "tooltip": "battery low", "icon": ""}Every key is optional. text and tooltip are strings, class is one of
normal, warn, urgent or muted (colored by the theme’s tokens), icon is exactly one character (a
glyph from a symbol font, as a static icon key takes), drawn before the
text instead of the module’s static icon while set, version is the shape this was
written for; a version above 1 is refused by name.
Unknown keys are ignored, so an older bar reads an update
carrying icon as if it were not there. Text and tooltip are cut at 256 bytes on a character boundary, and
every control character (a tab, a carriage return, an escape) becomes a
space, so nothing but printable text reaches the bar. A line or value
past 4096 bytes, or JSON nested more than 8 deep, is refused. The tooltip is
shown as a tooltip where the module has one.
An icon is drawn before a module’s text, em device pixels on a side (the size
of the text, at the output’s real scale, so it is sharp at 1.5x), with a space after it when text follows. Three keys
give one, at most one of them per module; the clock, button, push,
exec, volume,
microphone, network, battery, brightness, bluetooth, media, window-title
and power modules take them, and most of those take one glyph per state
or level besides (below). The workspaces
module takes none.
| Key | Takes | Drawn |
|---|---|---|
icon |
exactly one character: a glyph from a symbol font in the font chain | as text, in the state’s color |
icon-path |
SVG path data, a d string: M m L l H h V v C c S s Q q T t A a Z z, up to 16 KiB and 1024 commands |
filled by the bar itself, anti-aliased, tinted from the theme token of the module’s state (normal fg, warn accent, urgent urgent, muted dim), so it follows Stylix |
icon-viewbox |
"min-x min-y width height", only with icon-path; default "0 0 24 24" |
which part of the path’s plane is the icon, fitted into the square and centered |
icon-image |
an absolute path to a PNG file (a build with --features icon-image) |
scaled to the size, in its own colors (not tinted) |
[clock]# Material's "home", straight from an SVG's <path d="...">:icon-path = "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"# Font Awesome-style paths are on a 512 plane:# icon-path = "M..."# icon-viewbox = "0 0 512 512"![]()
A path that is not valid is a config error naming clock. and the
byte it stopped at (a refused reload leaves the running bar as it was). A viewbox
without a path, or two of the three icon keys, is an error too. A PNG is
decoded when the config is read, so a missing, unreadable, non-regular (a FIFO,
a device), huge (past 1024 x 1024 or 8 MiB), truncated or corrupt file is a
config error naming clock. and the file, and the file may be moved
afterward: the bar holds the picture, and drops it at the next reload. Give a
PNG at least as large as the icon; it is scaled by a premultiplied
bilinear/area filter and centered keeping its aspect ratio.
![]()
Without the icon-image feature icon-image is an unknown key, and the config
error says so. SVG files are not read: put the d string of a one-color icon in
icon-path, or convert a full-color SVG to PNG ahead of time.
Per-state and per-level icons
Section titled “Per-state and per-level icons”Where one glyph cannot say it (a charge, a signal, a state), the key takes
one glyph, or one glyph per level picked by the value, as the
network module does. Each entry takes exactly one
character, as icon does; an array takes exactly the count named, each one
glyph; anything else is a config error naming the dotted key. A per-state
glyph wins over the static icon for its own state (any other state shows
the static one), and a static path or picture has no levels: per-level
vector or PNG icons are out of scope.
| Module | Keys | Picks |
|---|---|---|
network |
icon-ethernet, icon-wifi, icon-vpn, icon-offline (or icon-ethernet-path, icon-vpn-path, icon-offline-path: path data) |
the state; icon-wifi takes one glyph, or 4 (weakest to strongest), picked by the signal level |
battery |
icon, plus icon-charging and icon-full |
icon takes one glyph, or 5 (empty to full, quintiles: 0–19, 20–39, 40–59, 60–79, 80–100); charging wins over the level, full over charging |
brightness |
icon |
one glyph, or 4 (dim to bright, quartiles: 0–24, 25–49, 50–74, 75–100) |
bluetooth |
icon-off, icon-on, icon-connected |
the state |
media |
icon-playing, icon-paused |
the state (a stopped player shows nothing, so there is no third key) |
window-title |
icon |
one static glyph, whenever a window is focused (never for the placeholder) |
power |
icon, plus icon-lock, icon-logout, icon-suspend, icon-reboot, icon-poweroff |
one glyph per menu row, drawn before its label; a row with none shows its label alone |
push |
icon |
one static glyph, drawn before the text; an update’s own icon wins for its own update |
exec |
icon |
one static glyph, drawn before the text; a JSON line’s own icon wins for its own line (a text line carries none) |
show-text = false draws only the icon, with the text moved into the
tooltip, which already names what the text said on every one of these
modules (the battery’s Discharging 72%, the brightness’s device, the
bluetooth state and device list, the media line, the full window title, the
network’s SSID and signal, and whatever tooltip a push update or an
exec line named, or the text itself where it named none), so an icon can stand alone where the text is
just a value, as with brightness and bluetooth. Without any icon the
module shows text alone.
Example: Nerd Font icons for every module
Section titled “Example: Nerd Font icons for every module”Glyphs from a symbol font in the font chain (Nerd Font’s Material Design set; each codepoint verified against Pictogrammers/MDI):
[bar]fallback-fonts = ["/path/to/SymbolsNerdFont-Regular.ttf"]
[battery]icon = ["\U000F008E", "\U000F007B", "\U000F007E", "\U000F0081", "\U000F0079"] # battery-outline, battery-20, battery-50, battery-80, battery: empty to fullicon-charging = "\U000F0084" # battery-chargingicon-full = "\U000F0079" # battery
[brightness]icon = ["\U000F00DD", "\U000F00DE", "\U000F00DF", "\U000F00E0"] # brightness-4, brightness-5, brightness-6, brightness-7: dim to bright, a sun at every level
[bluetooth]icon-off = "\U000F00B2" # bluetooth-officon-on = "\U000F00AF" # bluetoothicon-connected = "\U000F00B1" # bluetooth-connect
[media]icon-playing = "\U000F040A" # playicon-paused = "\U000F03E4" # pause
[window-title]icon = "\U000F08C6" # application
[network]icon-wifi = ["\U000F091F", "\U000F0922", "\U000F0925", "\U000F0928"] # wifi-strength-1..4: weakest to strongest
[power]icon = "\U000F0425" # power