waybar-sway-workspaces(5)
β¨ waybar-sway-workspaces(5) β¨
okay so bestie, welcome to the File Formats Manual entry for waybar-sway-workspaces β yes the whole name is a mouthful, we love her anyway π
πΈ NAME πΈ
waybar β the sway workspaces module, aka the little cutie that tells you where you are in Sway π¦
π DESCRIPTION π
The workspaces module displays the currently used workspaces in Sway. that's it, that's the job, and she does it flawlessly no cap π
π CONFIGURATION π
Addressed by sway/workspaces β that's how you get her attention in your config π«Ά
all-outputsβ typeof:bool, default:false. If set tofalse, workspaces will only be shown on the output they are on. If set totrue, all workspaces will be shown on every output. (main character workspaces, showing up everywhere β¨)formatβ typeof:string, default:{value}. The format, how information should be displayed.format-iconsβ typeof:array. Based on the workspace name and state, the corresponding icon gets selected. See icons πdisable-scrollβ typeof:bool, default:false. If set tofalse, you can scroll to cycle through workspaces. If set totruethis behaviour is disabled. (no scrolling for you π)reverse-scrollβ typeof:bool, default:false. If set tofalse, scrolling up will switch to the previous workspace and scrolling down will switch to the next workspace. If set totrue, the behavior will be reversed. (chaos mode, but make it intentional π₯)disable-clickβ typeof:bool, default:false. If set tofalse, you can click to change workspace. If set totruethis behaviour is disabled.smooth-scrolling-thresholdβ typeof:double. Threshold to be used when scrolling. (no default listed, she just vibes until you feed her a number π)disable-scroll-wraparoundβ typeof:bool, default:false. If set tofalse, scrolling on the workspace indicator will wrap around to the first workspace when reading the end, and vice versa. If set totruethis behavior is disabled. (no lil loop-de-loop for you π)enable-bar-scrollβ typeof:bool, default:false. If set tofalse, you can't scroll to cycle throughout workspaces from the entire bar. If set totruethis behaviour is enabled. (scroll the whole bar like a queen π)disable-markupβ typeof:bool, default:false. If set totrue, button label will escape pango markup.current-onlyβ typeof:bool, default:false. If set totrue. Only focused workspaces will be shown. (yes, the original really did put a period there, I'm just reporting the tea β)persistent-workspacesβ typeof:json(see below), default:empty. Lists workspaces that should always be shown, even when non-existent. (they're immortal, they're iconic, they stay π)on-updateβ typeof:string. Command to execute when the module is updated.disable-auto-back-and-forthβ typeof:bool. Whether to disableworkspace_auto_back_and_forthwhen clicking on workspaces. If this is set totrue, clicking on a workspace you are already on won't do anything, even ifworkspace_auto_back_and_forthis enabled in the Sway configuration. (no default listed btw, she's mysterious π¦)alphabetical_sortβ typeof:bool. Whether to sort workspaces alphabetically. Please note this can make"swaymsg workspace prev/next"move to workspaces inconsistent with the ordering shown in Waybar. (so pretty, so chaotic β pick your fighter π)warp-on-scrollβ typeof:bool, default:true. If set tofalse, you can scroll to cycle through workspaces without mouse warping being enabled. If set totruethis behaviour is disabled. (yes bestie, the default istrueand "true" turns the scrolling thing on while the wording says it's disabled β read it twice, I did π)window-rewriteβ typeof:object. Regex rules to map window class to an icon or preferred method of representation for a workspace's window.- Keys are the rules, while the values are the methods of representation. Rules may specify
class<...>,title<...>, or both in order to fine-tune the matching. You may assign an empty value to a rule to have it ignored from generating any representation in workspaces. For Wayland windowsclassis matched against theapp_id, and for X11 windows against theclassproperty. (the whole system is giving β¨organizedβ¨)
- Keys are the rules, while the values are the methods of representation. Rules may specify
window-rewrite-defaultβ typeof:string, default:"?". The default method of representation for a workspace's window. This will be used for windows whose classes do not match any of the rules inwindow-rewrite.format-window-separatorβ typeof:string, default:" ". The separator to be used between windows in a workspace.expandβ typeof:bool, default:false. Enables this module to consume all left over space dynamically. (she's hungry, she wants all the space π)
π FORMAT REPLACEMENTS π
the little placeholder besties you can drop into your format strings β¨
{value}: Name of the workspace, as defined by sway.{name}: Number stripped from workspace value.{icon}: Icon, as defined informat-icons.{index}: Index of the workspace.{output}: Output where the workspace is located.{windows}: Result fromwindow-rewrite
π¦ ICONS π¦
Additional to workspace name matching, the following format-icons can be set.
default: Will be shown, when no string matches are found.urgent: Will be shown, when workspace is flagged as urgentfocused: Will be shown, when workspace is focusedpersistent: Will be shown, when workspace is persistent.high-priority-named: Icons by names will be shown always for those workspaces, independent by state. (these ones are literally always invited to the party π )
π PERSISTENT WORKSPACES π
Each entry of persistent_workspace names a workspace that should always be shown. Associated with that value is a list of outputs indicating where the workspace should be shown, an empty list denoting all outputs.
"sway/workspaces": {
"persistent-workspaces": {
"3": [], // Always show a workspace with name '3', on all outputs if it does not exist
"4": ["eDP-1"], // Always show a workspace with name '4', on output 'eDP-1' if it does not exist
"5": ["eDP-1", "DP-2"] // Always show a workspace with name '5', on outputs 'eDP-1' and 'DP-2' if it does not exist
}
}
n.b.: the list of outputs can be obtained from command line using
swaymsg -t get_outputs
(go get that list, bestie, you got this πΈ)
π EXAMPLES π
example number one, the icon buffet:
"sway/workspaces": {
"disable-scroll": true,
"all-outputs": true,
"format": "{name}: {icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"high-priority-named": [ "1", "2" ],
"urgent": "",
"focused": "",
"default": ""
}
}
and example two, the window-rewrite glow-up (yes, the comments are doing the explaining, and yes they're staying exactly where they are):
"sway/workspaces": {
"format": "<span size='larger'>{name}</span> {windows}",
"format-window-separator": " | ",
"window-rewrite-default": "{name}",
"window-rewrite": {
"class<firefox>": "",
"class<kitty>": "k",
"title<.* - (.*) - VSCodium>": "codium $1" // captures part of the window title and formats it into output
}
}
π Style π
the CSS selectors you get to dress her up in π₯
#workspaces button#workspaces button.visible#workspaces button.focused#workspaces button.urgent#workspaces button.persistent#workspaces button.empty#workspaces button.current_output#workspaces button#sway-workspace-${name}
and that's the whole page bestie, you understood it, I'm so proud of you π«Ά
signed off on 2026-02-08, sealed with a kiss from waybar-sway-workspaces(5) β go slay your bar config πβ¨π
π¦ 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