1waybar(5) File Formats Manual waybar(5)
2
3
4
6 waybar - configuration file
7
9 The configuration uses the JSON file format and is named config.
10
11 Valid locations for this file are:
12
13 • $XDG_CONFIG_HOME/waybar/config
14 • ~/.config/waybar/config
15 • ~/waybar/config
16 • /etc/xdg/waybar/config
17 • /etc/xdg/waybar/config
18
19
20 A good starting point is the default configuration found at
21 https://github.com/Alexays/Waybar/blob/master/resources/config Also a
22 minimal example configuration can be found on the at the bottom of this
23 man page.
24
26 layer
27 typeof: string
28 default: bottom
29 Decide if the bar is displayed in front (top) of the windows or
30 behind (bottom)
31 them.
32
33 output
34 typeof: string|array
35 Specifies on which screen this bar will be displayed. Exclamation
36 mark(!) can be used to exclude specific output.
37
38 position
39 typeof: string
40 default: top
41 Bar position, can be top, bottom, left, right.
42
43 height
44 typeof: integer
45 Height to be used by the bar if possible. Leave blank for a dy‐
46 namic value.
47
48 width
49 typeof: integer
50 Width to be used by the bar if possible. Leave blank for a dynamic
51 value.
52
53 modules-left
54 typeof: array
55 Modules that will be displayed on the left.
56
57 modules-center
58 typeof: array
59 Modules that will be displayed in the center.
60
61 modules-right
62 typeof: array
63 Modules that will be displayed on the right.
64
65 margin
66 typeof: string
67 Margins value using the CSS format without units.
68
69 margin-<top|left|bottom|right>
70 typeof: integer
71 Margins value without units.
72
73 spacing
74 typeof: integer
75 Size of gaps in between of the different modules.
76
77 name
78 typeof: string
79 Optional name added as a CSS class, for styling multiple waybars.
80
81 mode
82 typeof: string
83 Selects one of the preconfigured display modes. This is an equiva‐
84 lent of the sway-bar(5) mode command and supports the same values:
85 dock, hide, invisible, overlay.
86 Note: hide and invisible modes may be not as useful without Sway
87 IPC.
88
89 modifier-reset
90 typeof: string
91 default: press
92 Defines the timing of modifier key to reset the bar visibility. To
93 reset the visibility of the bar with the press of the modifier key
94 use press. Use release to reset the visibility upon the release of
95 the modifier key and only if no other action happened while the key
96 was pressed. This prevents hiding the bar when the modifier is used
97 to switch a workspace, change binding mode or start a keybinding.
98
99 exclusive
100 typeof: bool
101 default: true
102 Option to request an exclusive zone from the compositor. Disable
103 this to allow drawing application windows underneath or on top of the
104 bar.
105
106 fixed-center
107 typeof: bool
108 default: true
109 Prefer fixed center position for the `modules-center` block. The
110 center block will stay in the middle of the bar whenever possible.
111 It can still be pushed around if other blocks need more space. When
112 false, the center block is centered in the space between the left
113 and right block.
114
115 passthrough
116 typeof: bool
117 default: false
118 Option to pass any pointer events to the window under the bar.
119 Intended to be used with either top or overlay layers and without
120 exclusive zone.
121
122 gtk-layer-shell
123 typeof: bool
124 default: true
125 Option to disable the use of gtk-layer-shell for popups.
126 Only functional if compiled with gtk-layer-shell support.
127
128 ipc
129 typeof: bool
130 default: false
131 Option to subscribe to the Sway IPC bar configuration and visibil‐
132 ity events and control waybar with swaymsg bar commands.
133 Requires bar_id value from sway configuration to be either passed
134 with the -b commandline argument or specified with the id option.
135
136 id
137 typeof: string
138 bar_id for the Sway IPC. Use this if you need to override the
139 value passed with the -b bar_id commandline argument for the specific
140 bar instance.
141
142 include
143 typeof: string|array
144 Paths to additional configuration files.
145 Each file can contain a single object with any of the bar configu‐
146 ration options. In case of duplicate options, the first defined
147 value takes precedence, i.e. including file -> first included file
148 -> etc. Nested includes are permitted, but make sure to avoid cir‐
149 cular imports. For a multi-bar config, the include directive af‐
150 fects only current bar configuration object.
151
153 You can use PangoMarkupFormat (See https://devel‐
154 oper.gnome.org/pango/stable/PangoMarkupFormat.html#PangoMarkupFormat).
155
156 e.g.
157
158 "format": "<span style="italic">{}</span>"
159
161 If you want to have a second instance of a module, you can suffix it by
162 a '#' and a custom name. For example if you want a second battery mod‐
163 ule, you can add "battery#bat2" to your modules. To configure the newly
164 added module, you then also add a module configuration with the same
165 name.
166
167 This could then look something like this (this is an incomplete exam‐
168 ple):
169
170 "modules-right": ["battery", "battery#bat2"],
171 "battery": {
172 "bat": "BAT1"
173 },
174 "battery#bat2": {
175 "bat": "BAT2"
176 }
177
179 A minimal config file could look like this:
180
181 {
182 "layer": "top",
183 "modules-left": ["sway/workspaces", "sway/mode"],
184 "modules-center": ["sway/window"],
185 "modules-right": ["battery", "clock"],
186 "sway/window": {
187 "max-length": 50
188 },
189 "battery": {
190 "format": "{capacity}% {icon}",
191 "format-icons": ["", "", "", "", ""]
192 },
193 "clock": {
194 "format-alt": "{:%a, %d. %b %H:%M}"
195 }
196 }
197
199 Limit a configuration to some outputs
200 {
201 "layer": "top",
202 "output": "eDP-1",
203 "modules-left": ["sway/workspaces", "sway/mode"],
204 ...
205
206 }
207
208
209 {
210 "layer": "top",
211 "output": ["eDP-1", "VGA"],
212 "modules-left": ["sway/workspaces", "sway/mode"],
213 ...
214 }
215
216
217 Configuration of multiple outputs
218 Don't specify an output to create multiple bars on the same screen.
219
220 [{
221 "layer": "top",
222 "output": "eDP-1",
223 "modules-left": ["sway/workspaces", "sway/mode"],
224 ...
225 }, {
226 "layer": "top",
227 "output": "VGA",
228 "modules-right": ["clock"],
229 ...
230 }]
231
232
233 Rotating modules
234 When positioning Waybar on the left or right side of the screen, some‐
235 times it's useful to be able to rotate the contents of a module so the
236 text runs vertically. This can be done using the "rotate" property of
237 the module. Example:
238
239 {
240 "clock": {
241 "rotate": 90
242 }
243 }
244
245 Valid options for the "rotate" property are: 0, 90, 180 and 270.
246
247 Grouping modules
248 Module groups allow stacking modules in the direction orthogonal to the
249 bar direction. When the bar is positioned on the top or bottom of the
250 screen, modules in a group are stacked vertically. Likewise, when posi‐
251 tioned on the left or right, modules in a group are stacked horizon‐
252 tally.
253
254 A module group is defined by specifying a module named "group/some-
255 group-name". The group must also be configured with a list of contained
256 modules. Example:
257
258 {
259 "modules-right": ["group/hardware", "clock"],
260
261 "group/hardware": {
262 "modules": [
263 "cpu",
264 "memory",
265 "battery"
266 ]
267 },
268
269 ...
270 }
271
273 • waybar-backlight(5)
274 • waybar-battery(5)
275 • waybar-bluetooth(5)
276 • waybar-clock(5)
277 • waybar-cpu(5)
278 • waybar-custom(5)
279 • waybar-disk(5)
280 • waybar-idle-inhibitor(5)
281 • waybar-keyboard-state(5)
282 • waybar-memory(5)
283 • waybar-mpd(5)
284 • waybar-network(5)
285 • waybar-pulseaudio(5)
286 • waybar-river-tags(5)
287 • waybar-states(5)
288 • waybar-sway-mode(5)
289 • waybar-sway-window(5)
290 • waybar-sway-workspaces(5)
291 • waybar-wlr-taskbar(5)
292 • waybar-wlr-workspaces(5)
293 • waybar-temperature(5)
294 • waybar-tray(5)
295
296
297
298 2022-05-23 waybar(5)