cowbar(1)
π cowbar(1) β cow status relay π
okay bestie, so cowbar is a lil command from the cow(1) family, and it's literally the group chat between your cow window manager and your status bar. let's get into it π«Ά
β¨ NAME β¨
cowbar β relay cow window manager status updates. that's it, that's the job π
πΈ SYNOPSIS πΈ
cowbar [-h] [-n] [-c path] [-o output] [-f field] [-w module]
π¦ DESCRIPTION π¦
so here's the vibe: cowbar connects to the cow(1) status socket and relays JSON state snapshots to standard output, one per line, whenever window or desk state changes. it's built to be a data source for status bars like waybar(1) or i3bar(1). no cap π
with no options, the full snapshot gets relayed verbatim. like, untouched, as-is, iconic behavior.
- the
-ooption filters snapshots to a single named output. - the
-foption extracts a single field from each snapshot.
and here's the bestie part: cowbar retries the socket connection up to 30 times (once per second), so you can start it concurrently with cow during session initialisation without needing any ordering guarantees. it just waits for you. loyal. π₯Ή
π OPTIONS π
-cpath β load style and format overrides from path. the installed defaults are loaded first, and an explicit file replaces those defaults.-ooutput β filter snapshots to an output name or selector. selectors are@N,@current,@next, and@prev, with the same meaning as in cow(1). when combined with-f desks, the desk information for that output is extracted. when used alone, the full state object for that output is emitted on each update.-ffield β extract a single field from each snapshot. valid values are:desksβ emit desk state for the selected output (or the first output if-ois not given). the emitted object containsdesks,current_desk, andoutputkeys.focusedβ emit the focused window object on each update. the object includesdisplay_title, which is already formatted by cow(1)'stitle_formatsetting. yes bestie, the formatting is done for you, you're welcome πlanguageβ emit the active keyboard layout and keyboard lock states as a Waybar-compatible text object.outputsβ emit the full outputs array on each update.
-nβ when used with-w desks, render desk names instead of numbers. it falls back to the number when a desk has no name, because nobody should be left nameless fr fr.-hβ print usage and exit. the classic escape hatch π
π WAYBAR PRESENTATION π
Waybar modules emitted with -w use Pango markup so that individual desks within a single custom module can have different styles. Waybar CSS can still style the custom module as a whole, but it cannot select the individual spans. sad but true.
the installed cowbar.conf supplies the default presentation. a readable $XDG_CONFIG_HOME/cow/cowbar.conf or ~/.config/cow/cowbar.conf override the defaults.
style lines π
style lines have the form:
style name attribute value [attribute value ...]
valid style names are desk.active, desk.collected, desk.occupied, desk.separator, page.separator, page, status, and title.
valid attributes are foreground, background, weight, style, and underline.
attribute values follow Pango markup conventions.
β οΈ quote colours beginning with#, since an unquoted#begins a comment. this one bites people, don't let it be you π«Ά
the special value none clears an attribute inherited from the installed defaults.
format lines π
format lines have the form:
format name "value"
the supported formats and required conversions are:
deskβ one%s(desk name or number)pageβ two%dvalues (column and row)statusβ%s,%d,%s(output, active-window count, desktop configuration)titleβ one%s(focused-window title)
use %% for a literal percent sign. dynamic text and configured Pango attribute values are escaped before markup is emitted.
layout π
the layout command controls the order of the three desk-module elements:
layout desks page status
valid elements are desks, page, and status. each may appear at most once. omit an element to hide it. the installed default shown above preserves the traditional cowbar order.
reloading π
send SIGHUP to a running cowbar process to reload its configuration. a successful reload immediately re-renders the most recent Waybar snapshot. if the new configuration is invalid, cowbar reports the error and keeps the previous configuration active. graceful queen behavior π
π OUTPUT FORMAT π
each line of output is a self-contained JSON object, suitable for parsing with jq(1) or any JSON library.
full snapshot (no -f):
{
"outputs": [
{
"name": "DP-1",
"desks": [...],
"current_desk": 1
}
],
"focused": {
"app_id": "foot",
"title": "fish",
"display_title": "[0123abcd] fish",
"desk": 1
},
"language": {
"name": "English (UK)",
"caps_lock": false,
"num_lock": true,
"scroll_lock": false
}
}
heads up bestie: thelanguage.caps_lock,language.num_lock, andlanguage.scroll_lockvalues arenulluntil River has reported those states for the keyboard providing the active layout. so if you seenull, that's not a bug, that's just β¨pendingβ¨.
-f desks output:
{"desks": [...], "current_desk": 1, "output": "DP-1"}
-f focused output:
{"app_id": "foot", "title": "fish", "display_title": "[0123abcd] fish", "desk": 1}
-f language output:
{"text": "English (UK)", "caps_lock": false, "num_lock": true, "scroll_lock": false}
-f outputs output:
[{"name": "DP-1", ...}, {"name": "HDMI-A-1", ...}]
π§ ENVIRONMENT π§
XDG_RUNTIME_DIRβ used to locate the status socket. must be set. like, mandatory, no wiggle room πWAYLAND_DISPLAYβ used to qualify the default status socket name so separate CoW instances in the same runtime directory do not share a status socket. sharing is caring except when it's chaos.
π FILES π
/<PREFIX>/etc/cow/cowbar.confβ installed default Waybar styles and formats.$XDG_CONFIG_HOME/cow/cowbar.confor~/.config/cow/cowbar.confβ optional per-user style and format overrides.$XDG_RUNTIME_DIR/cow-$WAYLAND_DISPLAY-status.sockβ status broadcast socket created by cow(1). cow writes a JSON snapshot to every connected client on each state change. ifWAYLAND_DISPLAYis unset, the fallback path is$XDG_RUNTIME_DIR/cow-status.sock.
β EXAMPLES β
relay all state snapshots:
cowbar
filter to output DP-1:
cowbar -o DP-1
extract desk state for output DP-1:
cowbar -f desks -o DP-1
extract focused window information:
cowbar -f focused
show the current keyboard layout:
cowbar -f language
pipe into jq(1) for the title of the focused window:
cowbar -f focused | jq -r '.title // empty'
override the active desk colour while retaining all other defaults:
style desk.active foreground "#ffffff" background "#75507b"
π SEE ALSO π
π AUTHORS π
Thomas Adam <thomas@xteddy.org>
and that's the whole thing bestie π this page is from cowbar 0.3, dated 2026-09-07, and it's the cowbar - cow status relay manual. go forth and relay those snapshots, you absolute icon πβ¨
π¦ where this page comes from
- fedora 44: cow 0.3-1.fc44 Β· ISC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms