waybar-sway-window(5)
π waybar-sway-window(5) π
okay bestie, sit down, hydrate, and let me tell you about the sway window module for waybar β this is section 5 of the file formats manual, so it's the config lore, not a command you run. no cap.
β¨ NAME β¨
waybar β the sway window module. that's it, that's the name, she's simple and she's iconic π
πΈ DESCRIPTION πΈ
The window module displays the title of the currently focused window in Sway. literally just that. your whole "what am i even looking at right now" problem? solved. main character energy for your bar πͺβ¨
π CONFIGURATION π
You address this one by its config key:
sway/window
and here's everything you can throw at her, one by one, no skipping, we don't do that here π«Ά
formatβ typeof:string, default:{title}. This is the format, likeβ¦ how the information should be displayed. the outfit the module wears.rotateβ typeof:integer. A positive value to rotate the text label, and it's in 90 degree increments. so it's giving "sideways era".max-lengthβ typeof:integer. The maximum length in character the module should display. yes, "character", singular, that's what it says, i'm not fixing the manpage's grammar, i'm just passing the message along πmin-lengthβ typeof:integer. The minimum length in characters the module should accept.alignβ typeof:float. The alignment of the label within the module, where0is left-aligned and1is right-aligned. if the module is rotated, it will follow the flow of the text. (she's adaptable, we love that)justifyβ typeof:string. The alignment of the text within the module's label β you can pass'left','right', or'center'to define the positioning.on-clickβ typeof:string. Command to execute when clicked on the module.on-click-middleβ typeof:string. Command to execute when middle-clicked on the module using mousewheel.on-click-rightβ typeof:string. Command to execute when you right-click on the module.on-updateβ typeof:string. Command to execute when the module is updated.on-scroll-upβ typeof:string. Command to execute when scrolling up on the module.on-scroll-downβ typeof:string. Command to execute when scrolling down on the module.smooth-scrolling-thresholdβ typeof:double. Threshold to be used when scrolling. for the β¨smoothβ¨ girlies.tooltipβ typeof:bool, default:true. Option to disable tooltip on hover. (default is ON, so if you want it gone you gotta say so, bestie)all-outputsβ typeof:bool, default:false. Option to show the focused window along with its workspace styles on all outputs.offscreen-cssβ typeof:bool, default:false. Only effective whenall-outputsistrue. Adds style according to present windows on unfocused outputs instead of showing the focused window and style.offscreen-css-textβ typeof:string. Only effective when bothall-outputsandoffscreen-stylearetrue. On screens currently not focused, show the given text along with that workspace styles.show-focused-workspace-nameβ typeof:bool, default:false. If the workspace itself is focused and the workspace containsnodesorfloating_nodes, show the workspace name. If not set, text remains empty β but styles according to nodes in the workspace are still applied. so like, silent but still slaying πshow-hidden-marksβ typeof:bool, default:false. For the{marks}format replacement, include hidden marks that start with an underscore. the sneaky ones. the undercover marks. πrewriteβ typeof:object. Rules to rewrite the module format output. see rewrite rules down below β¬οΈiconβ typeof:bool, default:false. Option to hide the application icon.icon-sizeβ typeof:integer, default:24. Option to change the size of the application icon.expandβ typeof:bool, default:false. Enables this module to consume all left over space dynamically. she's hungry for pixels, let her eat π₯
π¦ FORMAT REPLACEMENTS π¦
these are the little {} guys you can drop into your format string, and each one gets swapped for real info:
{title}β The title of the focused window.{app_id}β The app_id of the focused window.{shell}β The shell of the focused window. It's'xwayland'when the window is running through xwayland, otherwise, it's'xdg-shell'.{marks}β Marks of the window.
π REWRITE RULES π
rewrite is an object where keys are regular expressions and values are rewrite rules if the expression matches. Rules may contain references to captures of the expression. it's giving find-and-replace but make it fashion.
Regular expression and replacement follow ECMA-script rules. periodt.
If no expression matches, the format output is left unchanged.
Invalid expressions (e.g., mismatched parentheses) are skipped. she justβ¦ ignores them. no drama, no crash, silent treatment π
β EXAMPLES β
here's the vibe, copy-paste ready, character for character:
"sway/window": {
"format": "{}",
"max-length": 50,
"rewrite": {
"(.*) - Mozilla Firefox": "π $1",
"(.*) - zsh": "> [$1]"
}
}
look at that. $1 said "i'll hold your capture group". iconic behavior. π
π STYLE π
#window
The following classes are applied to the entire Waybar rather than just the window widget β so yeah, she's affecting the whole bar, global queen energy:
window#waybar.emptyβ When no windows are in the workspace, or screen is not focused andoffscreen-cssoption is not setwindow#waybar.soloβ When one tiled window is in the workspacewindow#waybar.floatingβ When there are only floating windows in the workspacewindow#waybar.stackedβ When there is more than one window in the workspace and the workspace layout isstackedwindow#waybar.tabbedβ When there is more than one window in the workspace and the workspace layout istabbedwindow#waybar.tiledβ When there is more than one window in the workspace and the workspace layout issplithorsplitvwindow#waybar.<app_id>β Whereapp_idis theapp_idor instance name like (chromium) of the only window in the workspace
ngl this page is fromwaybar-sway-window(5), dated2026-02-08. that's the source, that's the version, that's the whole footer, and i folded it in here so you'd still have it. bye bestie, go style your bar, you're gonna eat ππΈπ«Ά
π¦ where this page comes from
- ubuntu resolute: waybar 0.15.0-1 Β· MIT
- ubuntu stonking: waybar 0.15.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms