1sway-bar(5) File Formats Manual sway-bar(5)
2
3
4
6 sway-bar - bar configuration file and commands
7
9 Sway allows configuring swaybar in the sway configuration file.
10
12 status_command <status command>
13 Executes the bar status command with sh -c. Each line of text
14 printed to stdout from this command will be displayed in the status
15 area of the bar. You may also use the i3bar JSON protocol:
16
17 https://i3wm.org/docs/i3bar-protocol.html
18
19 If running this command via IPC, you can disable a running status
20 command by setting the command to a single dash: swaybar bar bar-0
21 status_command -
22
23 pango_markup enabled|disabled
24 Enables or disables pango markup for status lines. This has no
25 effect on status lines using the i3bar JSON protocol.
26
27 id <bar_id>
28 Sets the ID of the bar.
29
30 position top|bottom
31 Sets position of the bar. Default is bottom.
32
33 output <output>
34 Restrict the bar to a certain output, can be specified multiple
35 times. If the output command is omitted, the bar will be displayed
36 on all outputs.
37
38 swaybar_command <command>
39 Executes custom bar command. Default is swaybar.
40
41 font <font>
42 Specifies the font to be used in the bar.
43
44 separator_symbol <symbol>
45 Specifies the separator symbol to separate blocks on the bar.
46
47 wrap_scroll yes|no
48 Enables or disables wrapping when scrolling through workspaces with
49 the scroll wheel. Default is no.
50
51 workspace_buttons yes|no
52 Enables or disables workspace buttons on the bar. Default is yes.
53
54 strip_workspace_name yes|no
55 If set to yes, then workspace names will be omitted from the
56 workspace button and only the custom number will be shown. Default
57 is no.
58
59 strip_workspace_numbers yes|no
60 If set to yes, then workspace numbers will be omitted from the
61 workspace button and only the custom name will be shown. Default is
62 no.
63
64 binding_mode_indicator yes|no
65 Enable or disable binding mode indicator. Default is yes.
66
67 gaps <all> | <horizontal> <vertical> | <top> <right> <bottom> <left>
68 Sets the gaps from the edge of the screen for the bar. Gaps can
69 either be set all at once, per direction, or per side. Note that
70 only sides that touch an edge of the screen can have gaps. For the
71 side that does not touch an edge of the screen, per-side outer gaps
72 for workspaces may be of use.
73
74 height <height>
75 Sets the height of the bar. Default height (0) will match the font
76 size.
77
78 bindcode [--release] <event-code> <command>
79 Executes command when the mouse button has been pressed (or if
80 released is given, when the button has been released). The buttons
81 can be given as an event code, which can be obtaining from `libin‐
82 put debug-events`. To disable the default behavior for a button,
83 use the command nop.
84
85 bindsym [--release] button[1-9]|<event-name> <command>
86 Executes command when the mouse button has been pressed (or if
87 released is given, when the button has been released). The buttons
88 can be given as a x11 button number or an event name, which can be
89 obtained from `libinput debug-events`. To disable the default
90 behavior for a button, use the command nop.
91
92 mode dock|hide|invisible|overlay
93 Specifies the visibility of the bar. In dock mode, it is perma‐
94 nently visible at one edge of the screen. In hide mode, it is hid‐
95 den unless the modifier key is pressed, though this behaviour
96 depends on the hidden state. In invisible mode, it is permanently
97 hidden. In overlay mode, it is permanently visible on top of other
98 windows. (In overlay mode the bar is transparent to input events.)
99 Default is dock.
100
101 hidden_state hide|show
102 Specifies the behaviour of the bar when it is in hide mode. When
103 the hidden state is hide, then it is normally hidden, and only
104 unhidden by pressing the modifier key or in case of urgency hints.
105 When the hidden state is show, then it is permanently visible,
106 drawn on top of the currently visible workspace. Default is hide.
107
108 modifier <Modifier>|none
109 Specifies the modifier key that shows a hidden bar. Default is
110 Mod4.
111
112 status_padding <padding>
113 Sets the vertical padding that is used for the status line. The
114 default is 1. If padding is 0, blocks will be able to take up the
115 full height of the bar. This value will be multiplied by the output
116 scale.
117
118 status_edge_padding <padding>
119 Sets the padding that is used when the status line is at the right
120 edge of the bar. This value will be multiplied by the output scale.
121 The default is 3.
122
123 unbindcode [--release] <event-code>
124 Removes the binding with the given <event-code>.
125
126 unbindsym [--release] button[1-9]|<event-name>
127 Removes the binding with the given <button> or <event-name>.
128
129 TRAY
130 Swaybar provides a system tray where third-party applications may place
131 icons. The following commands configure the tray.
132
133 tray_bindcode <event-code> ContextMenu|Activate|SecondaryActi‐
134 vate|ScrollDown|ScrollLeft|ScrollRight|ScrollUp|nop
135 Executes the action when the mouse button has been pressed. The
136 buttons can be given as an event code, which can be obtained from
137 `libinput debug-events`. To disable the default behavior for a
138 button, use the command nop.
139
140 tray_bindsym button[1-9]|<event-name> ContextMenu|Activate|SecondaryAc‐
141 tivate|ScrollDown|ScrollLeft|ScrollRight|ScrollUp|nop
142 Executes the action when the mouse button has been pressed. The
143 buttons can be given as a x11 button number or an event name, which
144 can be obtained from `libinput debug-events`. Use the command nop
145 to disable the default action (Activate for button1, ContextMenu
146 for button2 and SecondaryActivate for button3).
147
148 tray_padding <px> [px]
149 Sets the pixel padding of the system tray. This padding will sur‐
150 round the tray on all sides and between each item. The default
151 value for px is 2.
152
153 tray_output none|<output>
154 Restrict the tray to a certain output, can be specified multiple
155 times. If omitted, the tray will be displayed on all outputs.
156 Unlike i3bar, swaybar can show icons on any number of bars and out‐
157 puts without races.
158
159 icon_theme <name>
160 Sets the icon theme that sway will look for item icons in. This
161 option has no default value, because sway will always default to
162 the fallback theme, hicolor.
163
164 COLORS
165 Colors are defined within a colors { } block inside a bar { } block.
166 Colors must be defined in hex: #RRGGBB or #RRGGBBAA.
167
168 background <color>
169 Background color of the bar.
170
171 statusline <color>
172 Text color to be used for the statusline.
173
174 separator <color>
175 Text color to be used for the separator.
176
177 focused_background <color>
178 Background color of the bar on the currently focused monitor out‐
179 put. If not used, the color will be taken from background.
180
181 focused_statusline <color>
182 Text color to be used for the statusline on the currently focused
183 monitor output. If not used, the color will be taken from sta‐
184 tusline.
185
186 focused_separator <color>
187 Text color to be used for the separator on the currently focused
188 monitor output. If not used, the color will be taken from separa‐
189 tor.
190
191 focused_workspace <border> <background> <text>
192 Border, background and text color for a workspace button when the
193 workspace has focus.
194
195 active_workspace <border> <background> <text>
196 Border, background and text color for a workspace button when the
197 workspace is active (visible) on some output, but the focus is on
198 another one. You can only tell this apart from the focused
199 workspace when you are using multiple monitors.
200
201 inactive_workspace <border> <background> <text>
202 Border, background and text color for a workspace button when the
203 workspace does not have focus and is not active (visible) on any
204 output. This will be the case for most workspaces.
205
206 urgent_workspace <border> <background> <text>
207 Border, background and text color for a workspace button when the
208 workspace contains a window with the urgency hint set.
209
210 binding_mode <border> <background> <text>
211 Border, background and text color for the binding mode indicator.
212 If not used, the colors will be taken from urgent_workspace.
213
215 sway(5)
216
217 2019-07-27 sway-bar(5)