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 name
74 typeof: string
75 Optional name added as a CSS class, for styling multiple waybars.
76
77 exclusive
78 typeof: bool
79 default: true unless the layer is set to overlay
80 Option to request an exclusive zone from the compositor. Disable
81 this to allow drawing application windows underneath or on top of the
82 bar.
83
84 passthrough
85 typeof: bool
86 default: false unless the layer is set to overlay
87 Option to pass any pointer events to the window under the bar.
88 Intended to be used with either top or overlay layers and without
89 exclusive zone.
90
91 gtk-layer-shell
92 typeof: bool
93 default: true
94 Option to disable the use of gtk-layer-shell for popups.
95 Only functional if compiled with gtk-layer-shell support.
96
97 include
98 typeof: string|array
99 Paths to additional configuration files. In case of duplicate op‐
100 tions, the including file's value takes precedence. Make sure to avoid
101 circular imports.
102 For a multi-bar config, specify at least an empty object for each
103 bar also in every file being included.
104
106 You can use PangoMarkupFormat (See https://devel‐
107 oper.gnome.org/pango/stable/PangoMarkupFormat.html#PangoMarkupFormat).
108
109 e.g.
110
111 "format": "<span style="italic">{}</span>"
112
114 If you want to have a second instance of a module, you can suffix it by
115 a '#' and a custom name. For example if you want a second battery mod‐
116 ule, you can add "battery#bat2" to your modules. To configure the newly
117 added module, you then also add a module configuration with the same
118 name.
119
120 This could then look something like this (this is an incomplete exam‐
121 ple):
122
123 "modules-right": ["battery", "battery#bat2"],
124 "battery": {
125 "bat": "BAT1"
126 },
127 "battery#bat2": {
128 "bat": "BAT2"
129 }
130
132 A minimal config file could look like this:
133
134 {
135 "layer": "top",
136 "modules-left": ["sway/workspaces", "sway/mode"],
137 "modules-center": ["sway/window"],
138 "modules-right": ["battery", "clock"],
139 "sway/window": {
140 "max-length": 50
141 },
142 "battery": {
143 "format": "{capacity}% {icon}",
144 "format-icons": ["", "", "", "", ""]
145 },
146 "clock": {
147 "format-alt": "{:%a, %d. %b %H:%M}"
148 }
149 }
150
152 Limit a configuration to some outputs
153 {
154 "layer": "top",
155 "output": "eDP-1",
156 "modules-left": ["sway/workspaces", "sway/mode"],
157 ...
158
159 }
160
161
162 {
163 "layer": "top",
164 "output": ["eDP-1", "VGA"],
165 "modules-left": ["sway/workspaces", "sway/mode"],
166 ...
167 }
168
169
170 Configuration of multiple outputs
171 Don't specify an output to create multiple bars on the same screen.
172
173 [{
174 "layer": "top",
175 "output": "eDP-1",
176 "modules-left": ["sway/workspaces", "sway/mode"],
177 ...
178 }, {
179 "layer": "top",
180 "output": "VGA",
181 "modules-right": ["clock"],
182 ...
183 }]
184
185
186 Rotating modules
187 When positioning Waybar on the left or right side of the screen, some‐
188 times it's useful to be able to rotate the contents of a module so the
189 text runs vertically. This can be done using the "rotate" property of
190 the module. Example:
191
192 {
193 "clock": {
194 "rotate": 90
195 }
196 }
197
198 Valid options for the "rotate" property are: 0, 90, 180 and 270.
199
201 • waybar-backlight(5)
202 • waybar-battery(5)
203 • waybar-bluetooth(5)
204 • waybar-clock(5)
205 • waybar-cpu(5)
206 • waybar-custom(5)
207 • waybar-disk(5)
208 • waybar-idle-inhibitor(5)
209 • waybar-keyboard-state(5)
210 • waybar-memory(5)
211 • waybar-mpd(5)
212 • waybar-network(5)
213 • waybar-pulseaudio(5)
214 • waybar-river-tags(5)
215 • waybar-states(5)
216 • waybar-sway-mode(5)
217 • waybar-sway-window(5)
218 • waybar-sway-workspaces(5)
219 • waybar-wlr-taskbar(5)
220 • waybar-temperature(5)
221 • waybar-tray(5)
222
223
224
225 2021-11-02 waybar(5)