1sway(5) File Formats Manual sway(5)
2
3
4
6 sway - configuration file and commands
7
9 A sway configuration file is a list of sway commands that are executed
10 by sway on startup. These commands usually consist of setting your
11 preferences and setting key bindings. An example config is likely
12 present in /etc/sway/config for you to check out.
13
14 Lines in the configuration file might be extended through multiple
15 lines by adding a '\' character at the end of line. e.g.:
16
17 bindsym Shift+XF86AudioRaiseVolume exec \
18 pactl set-sink-volume @DEFAULT_SINK@ -1%
19
20 Commands can also be given as a block in the form command { <subcom‐
21 mands...> }. Anything before the opening { will be prepended to the
22 lines inside the block. For example:
23
24 output eDP-1 {
25 background ~/wallpaper.png fill
26 resolution 1920x1080
27 }
28
29 is identical to
30
31 output eDP-1 background ~/wallpaper.png fill
32 output eDP-1 resolution 1920x1080
33
34 These commands can be executed in your config file, via swaymsg(1), or
35 via the bindsym command.
36
38 Commands are split into several arguments using spaces. You can enclose
39 arguments with quotation marks ("..." or '...') to add spaces to a sin‐
40 gle argument. You may also run several commands in order by separating
41 each with , or ;. Criteria is retained across commands separated by ,,
42 but will be reset (and allow for new criteria, if desired) for commands
43 separated by a ;.
44
45 Throughout the documentation, | is used to distinguish between argu‐
46 ments for which you may only select one. [...] is used for optional ar‐
47 guments, and <...> for arguments where you are expected to supply some
48 value.
49
51 This section only lists general commands. For input and output com‐
52 mands, refer to sway-input(5) and sway-output(5).
53
54 The following commands may only be used in the configuration file.
55
56 bar [<bar-id>] <bar-subcommands...>
57 For details on bar subcommands, see sway-bar(5).
58
59 default_orientation horizontal|vertical|auto
60 Sets the default container layout for tiled containers.
61
62 include <path>
63 Includes another file from path. path can be either a full path or
64 a path relative to the parent config, and expands shell syntax (see
65 wordexp(3) for details). The same include file can only be included
66 once; subsequent attempts will be ignored.
67
68 swaybg_command <command>
69 Executes custom background command. Default is swaybg. Refer to
70 sway-output(5) for more information.
71
72 It can be disabled by setting the command to a single dash:
73 swaybg_command -
74
75 swaynag_command <command>
76 Executes custom command for swaynag. Default is swaynag. Additional
77 arguments may be appended to the end. This should only be used to
78 either direct sway to call swaynag from a custom path or to provide
79 additional arguments. This should be placed at the top of the con‐
80 fig for the best results.
81
82 It can be disabled by setting the command to a single dash: sway‐
83 nag_command -
84
85 workspace_layout default|stacking|tabbed
86 Specifies the initial layout for new containers in an empty
87 workspace.
88
89 xwayland enable|disable|force
90 Enables or disables Xwayland support, which allows X11 applications
91 to be used. enable will lazily load Xwayland so Xwayland will not
92 be launched until the first client attempts to connect. In some
93 cases, such as slower machines, it may be desirable to have Xway‐
94 land started immediately by using force instead of enable.
95
96 The following commands cannot be used directly in the configuration
97 file. They are expected to be used with bindsym or at runtime through
98 swaymsg(1).
99
100 border none|normal|csd|pixel [<n>]
101 Set border style for focused window. normal includes a border of
102 thickness n and a title bar. pixel is a border without title bar n
103 pixels thick. Default is normal with border thickness 2. csd is
104 short for client-side-decorations, which allows the client to draw
105 its own decorations.
106
107 border toggle
108 Cycles through the available border styles.
109
110 exit
111 Exit sway and end your Wayland session.
112
113 floating enable|disable|toggle
114 Make focused view floating, non-floating, or the opposite of what
115 it is now.
116
117 <criteria> focus
118 Moves focus to the container that matches the specified criteria.
119
120 focus up|right|down|left
121 Moves focus to the next container in the specified direction.
122
123 focus prev|next [sibling]
124 Moves focus to the previous or next container in the current lay‐
125 out. By default, the last active child of the newly focused con‐
126 tainer will be focused. The sibling option indicates not to immedi‐
127 ately focus a child of the container.
128
129 focus child
130 Moves focus to the last-focused child of the focused container.
131
132 focus parent
133 Moves focus to the parent of the focused container.
134
135 focus output up|right|down|left
136 Moves focus to the next output in the specified direction.
137
138 focus output <name>
139 Moves focus to the named output.
140
141 focus tiling
142 Sets focus to the last focused tiling container.
143
144 focus floating
145 Sets focus to the last focused floating container.
146
147 focus mode_toggle
148 Moves focus between the floating and tiled layers.
149
150 fullscreen [enable|disable|toggle] [global]
151 Makes focused view fullscreen, non-fullscreen, or the opposite of
152 what it is now. If no argument is given, it does the same as tog‐
153 gle. If global is specified, the view will be fullscreen across all
154 outputs.
155
156 gaps inner|outer|horizontal|vertical|top|right|bottom|left all|current
157 set|plus|minus|toggle <amount>
158 Changes the inner or outer gaps for either all workspaces or the
159 current workspace. outer gaps can be altered per side with top,
160 right, bottom, and left or per direction with horizontal and verti‐
161 cal.
162
163 inhibit_idle focus|fullscreen|open|none|visible
164 Set/unset an idle inhibitor for the view. focus will inhibit idle
165 when the view is focused by any seat. fullscreen will inhibit idle
166 when the view is fullscreen (or a descendant of a fullscreen con‐
167 tainer) and is visible. open will inhibit idle until the view is
168 closed (or the inhibitor is unset/changed). visible will inhibit
169 idle when the view is visible on any output. none will remove any
170 existing idle inhibitor for the view.
171
172 This can also be used with criteria to set an idle inhibitor for
173 any existing view or with for_window to set idle inhibitors for fu‐
174 ture views.
175
176 layout default|splith|splitv|stacking|tabbed
177 Sets the layout mode of the focused container.
178
179 layout toggle [split|all]
180 Cycles the layout mode of the focused container though a preset
181 list of layouts. If no argument is given, then it cycles through
182 stacking, tabbed and the last split layout. If split is given, then
183 it cycles through splith and splitv. If all is given, then it cy‐
184 cles through every layout.
185
186 layout toggle [split|tabbed|stacking|splitv|splith]
187 [split|tabbed|stacking|splitv|splith]...
188 Cycles the layout mode of the focused container through a list of
189 layouts.
190
191 max_render_time off|<msec>
192 Controls when the relevant application is told to render this win‐
193 dow, as a positive number of milliseconds before the next time sway
194 composites the output. A smaller number leads to fresher rendered
195 frames being composited by sway and lower perceived input latency,
196 but if set too low, the application may not finish rendering before
197 sway composites the output, leading to delayed frames.
198
199 When set to off, the relevant application is told to render this
200 window immediately after display refresh. How much time is left for
201 rendering before sway composites the output at that point depends
202 on the output max_render_time setting.
203
204 To set this up for optimal latency:
205 1. Set up output max_render_time (see sway-output(5)).
206 2. Put the target application in full-screen and have it continu‐
207 ously render something.
208 3. Start by setting max_render_time 1. If the application drops
209 frames, increment by 1.
210
211
212 This setting only has an effect if a per-output max_render_time is
213 in effect on the output the window is currently on. See sway-out‐
214 put(5) for further details.
215
216 move left|right|up|down [<px> px]
217 Moves the focused container in the direction specified. If the con‐
218 tainer, the optional px argument specifies how many pixels to move
219 the container. If unspecified, the default is 10 pixels. Pixels are
220 ignored when moving tiled containers.
221
222 move [absolute] position <pos_x> [px|ppt] <pos_y> [px|ppt]
223 Moves the focused container to the specified position in the
224 workspace. The position can be specified in pixels or percentage
225 points, omitting the unit defaults to pixels. If absolute is
226 used, the position is relative to all outputs. absolute can not be
227 used with percentage points.
228
229 move [absolute] position center
230 Moves the focused container to be centered on the workspace. If ab‐
231 solute is used, it is moved to the center of all outputs.
232
233 move position cursor|mouse|pointer
234 Moves the focused container to be centered on the cursor.
235
236 move [container|window] [to] mark <mark>
237 Moves the focused container to the specified mark.
238
239 move [--no-auto-back-and-forth] [container|window] [to] workspace [num‐
240 ber] <name>
241 Moves the focused container to the specified workspace. The string
242 number is optional and is used to match a workspace with the same
243 number, even if it has a different name.
244
245 move [container|window] [to] workspace prev|next|current
246 Moves the focused container to the previous, next or current
247 workspace on this output, or if no workspaces remain, the previous
248 or next output.
249
250 move [container|window] [to] workspace prev_on_output|next_on_output
251 Moves the focused container to the previous or next workspace on
252 this output, wrapping around if already at the first or last
253 workspace.
254
255 move [container|window] [to] workspace back_and_forth
256 Moves the focused container to previously focused workspace.
257
258 move [container|window] [to] output <name-or-id>|current
259 Moves the focused container to the specified output.
260
261 move [container|window] [to] output up|right|down|left
262 Moves the focused container to next output in the specified direc‐
263 tion.
264
265 move [container|window] [to] scratchpad
266 Moves the focused container to the scratchpad.
267
268 move workspace [to] output <name-or-id>|current
269 Moves the focused workspace to the specified output.
270
271 move workspace to [output] <name-or-id>|current
272 Moves the focused workspace to the specified output.
273
274 move workspace [to] output up|right|down|left
275 Moves the focused workspace to next output in the specified direc‐
276 tion.
277
278 move workspace to [output] up|right|down|left
279 Moves the focused workspace to next output in the specified direc‐
280 tion.
281
282 nop <comment>
283 A no operation command that can be used to override default behav‐
284 iour. The optional comment argument is ignored, but logged for de‐
285 bugging purposes.
286
287 reload
288 Reloads the sway config file and applies any changes. The config
289 file is located at path specified by the command line arguments
290 when started, otherwise according to the priority stated in
291 sway(1).
292
293 rename workspace [<old_name>] to <new_name>
294 Rename either <old_name> or the focused workspace to the <new_name>
295
296 resize shrink|grow width|height [<amount> [px|ppt]]
297 Resizes the currently focused container by amount, specified in
298 pixels or percentage points. If the units are omitted, floating
299 containers are resized in px and tiled containers by ppt. amount
300 will default to 10 if omitted.
301
302 resize set height <height> [px|ppt]
303 Sets the height of the container to height, specified in pixels or
304 percentage points. If the units are omitted, floating containers
305 are resized in px and tiled containers by ppt. If height is 0, the
306 container will not be resized.
307
308 resize set [width] <width> [px|ppt]
309 Sets the width of the container to width, specified in pixels or
310 percentage points. If the units are omitted, floating containers
311 are resized in px and tiled containers by ppt. If width is 0, the
312 container will not be resized.
313
314 resize set [width] <width> [px|ppt] [height] <height> [px|ppt]
315 Sets the width and height of the container to width and height,
316 specified in pixels or percentage points. If the units are omitted,
317 floating containers are resized in px and tiled containers by ppt.
318 If width or height is 0, the container will not be resized on that
319 axis.
320
321 scratchpad show
322 Shows a window from the scratchpad. Repeatedly using this command
323 will cycle through the windows in the scratchpad.
324
325 shortcuts_inhibitor enable|disable
326 Enables or disables the ability of clients to inhibit keyboard
327 shortcuts for a view. This is primarily useful for virtualization
328 and remote desktop software. It affects either the currently fo‐
329 cused view or a set of views selected by criteria. Subcommand dis‐
330 able additionally deactivates any active inhibitors for the given
331 view(s). Criteria are particularly useful with the for_window com‐
332 mand to configure a class of views differently from the per-seat
333 defaults established by the seat subcommand of the same name. See
334 sway-input(5) for more ways to affect inhibitors.
335
336 split vertical|v|horizontal|h|none|n|toggle|t
337 Splits the current container, vertically or horizontally. When none
338 is specified, the effect of a previous split is undone if the cur‐
339 rent container is the only child of a split parent. When toggle is
340 specified, the current container is split opposite to the parent
341 container's layout.
342
343 splith
344 Equivalent to split horizontal
345
346 splitv
347 Equivalent to split vertical
348
349 splitt
350 Equivalent to split toggle
351
352 sticky enable|disable|toggle
353 "Sticks" a floating window to the current output so that it shows
354 up on all workspaces.
355
356 swap container with id|con_id|mark <arg>
357 Swaps the position, geometry, and fullscreen status of two contain‐
358 ers. The first container can be selected either by criteria or fo‐
359 cus. The second container can be selected by id, con_id, or mark.
360 id can only be used with xwayland views. If the first container has
361 focus, it will retain focus unless it is moved to a different
362 workspace or the second container becomes fullscreen on the same
363 workspace as the first container. In either of those cases, the
364 second container will gain focus.
365
366 title_format <format>
367 Sets the format of window titles. The following placeholders may be
368 used:
369
370 %title - The title supplied by the window
371 %app_id - The wayland app ID (applicable to wayland
372 windows only)
373 %class - The X11 classname (applicable to xwayland
374 windows only)
375 %instance - The X11 instance (applicable to xwayland
376 windows only)
377 %shell - The protocol the window is using (typically
378 xwayland or
379 xdg_shell)
380
381 This command is typically used with for_window criteria. For exam‐
382 ple:
383
384 for_window [title="."] title_format "<b>%title</b> (%app_id)"
385
386 Note that markup requires pango to be enabled via the font command.
387
388 The default format is "%title".
389
390 The following commands may be used either in the configuration file or
391 at runtime.
392
393 assign <criteria> [→] [workspace] [number] <workspace>
394 Assigns views matching criteria (see CRITERIA for details) to
395 workspace. The → (U+2192) is optional and cosmetic. This command is
396 equivalent to:
397
398 for_window <criteria> move container to workspace <workspace>
399
400 assign <criteria> [→] output left|right|up|down|<name>
401 Assigns views matching criteria (see CRITERIA for details) to the
402 specified output. The → (U+2192) is optional and cosmetic. This
403 command is equivalent to:
404
405 for_window <criteria> move container to output <output>
406
407 bindsym [--whole-window] [--border] [--exclude-titlebar] [--release]
408 [--locked] [--to-code] [--input-device=<device>] [--no-warn] [--no-re‐
409 peat] [Group<1-4>+]<key combo> <command>
410 Binds key combo to execute the sway command command when pressed.
411 You may use XKB key names here (wev(1) is a good tool for discover‐
412 ing these). With the flag --release, the command is executed when
413 the key combo is released. If input-device is given, the binding
414 will only be executed for that input device and will be executed
415 instead of any binding that is generic to all devices. If a group
416 number is given, then the binding will only be available for that
417 group. By default, if you overwrite a binding, swaynag will give
418 you a warning. To silence this, use the --no-warn flag.
419
420 Unless the flag --locked is set, the command will not be run when a
421 screen locking program is active. If there is a matching binding
422 with and without --locked, the one with will be preferred when
423 locked and the one without will be preferred when unlocked. If
424 there are matching bindings and one has both --input-device and
425 --locked and the other has neither, the former will be preferred
426 even when unlocked.
427
428 Unless the flag --inhibited is set, the command will not be run
429 when a keyboard shortcuts inhibitor is active for the currently fo‐
430 cused window. Such inhibitors are usually requested by remote desk‐
431 top and virtualization software to enable the user to send keyboard
432 shortcuts to the remote or virtual session. The --inhibited flag
433 allows one to define bindings which will be exempt from pass-
434 through to such software. The same preference logic as for --locked
435 applies.
436
437 Unless the flag --no-repeat is set, the command will be run repeat‐
438 edly when the key is held, according to the repeat settings speci‐
439 fied in the input configuration.
440
441 Bindings to keysyms are layout-dependent. This can be changed with
442 the --to-code flag. In this case, the keysyms will be translated
443 into the corresponding keycodes in the first configured layout.
444
445 Mouse bindings operate on the container under the cursor instead of
446 the container that has focus. Mouse buttons can either be specified
447 in the form button[1-9] or by using the name of the event code (ex
448 BTN_LEFT or BTN_RIGHT). For the former option, the buttons will be
449 mapped to their values in X11 (1=left, 2=middle, 3=right, 4=scroll
450 up, 5=scroll down, 6=scroll left, 7=scroll right, 8=back, 9=for‐
451 ward). For the latter option, you can find the event names using
452 libinput debug-events.
453
454 The priority for matching bindings is as follows: input device,
455 group, and locked state.
456
457 --whole-window, --border, and --exclude-titlebar are mouse-only op‐
458 tions which affect the region in which the mouse bindings can be
459 triggered. By default, mouse bindings are only triggered when over
460 the title bar. With the --border option, the border of the window
461 will be included in this region. With the --whole-window option,
462 the cursor can be anywhere over a window including the title, bor‐
463 der, and content. --exclude-titlebar can be used in conjunction
464 with any other option to specify that the titlebar should be ex‐
465 cluded from the region of consideration.
466
467 If --whole-window is given, the command can be triggered when the
468 cursor is over an empty workspace. Using a mouse binding over a
469 layer surface's exclusive region is not currently possible.
470
471 Example:
472 # Execute firefox when alt, shift, and f are pressed together
473 bindsym Mod1+Shift+f exec firefox
474
475 bindcode [--whole-window] [--border] [--exclude-titlebar] [--re‐
476 lease] [--locked] [--input-device=<device>] [--no-warn]
477 [Group<1-4>+]<code> <command> is also available for binding with
478 key/button codes instead of key/button names.
479
480 bindswitch [--locked] [--no-warn] [--reload] <switch>:<state> <command>
481 Binds <switch> to execute the sway command command on state
482 changes. Supported switches are lid (laptop lid) and tablet (tablet
483 mode) switches. Valid values for state are on, off and toggle.
484 These switches are on when the device lid is shut and when tablet
485 mode is active respectively. toggle is also supported to run a com‐
486 mand both when the switch is toggled on or off.
487
488 Unless the flag --locked is set, the command will not be run when a
489 screen locking program is active. If there is a matching binding
490 with and without --locked, the one with will be preferred when
491 locked and the one without will be preferred when unlocked.
492
493 If the --reload flag is given, the binding will also be executed
494 when the config is reloaded. toggle bindings will not be executed
495 on reload. The --locked flag will operate as normal so if the con‐
496 fig is reloaded while locked and --locked is not given, the binding
497 will not be executed.
498
499 By default, if you overwrite a binding, swaynag will give you a
500 warning. To silence this, use the --no-warn flag.
501
502 Example:
503 # Show the virtual keyboard when tablet mode is entered.
504 bindswitch tablet:on busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
505
506 # Log a message when the laptop lid is opened or closed.
507 bindswitch lid:toggle exec echo "Lid moved"
508
509 client.background <color>
510 This command is ignored and is only present for i3 compatibility.
511
512 client.<class> <border> <background> <text> [<indicator> [<child_bor‐
513 der>]]
514 Configures the color of window borders and title bars. The first
515 three colors are required. When omitted indicator will use a sane
516 default and child_border will use the color set for background.
517 Colors may be specified in hex, either as #RRGGBB or #RRGGBBAA.
518
519 The available classes are:
520
521 client.focused
522 The window that has focus.
523
524 client.focused_inactive
525 The most recently focused view within a container which is not
526 focused.
527
528 client.focused_tab_title
529 A view that has focused descendant container. Tab or stack con‐
530 tainer title that is the parent of the focused container but is
531 not directly focused. Defaults to focused_inactive if not spec‐
532 ified and does not use the indicator and child_border colors.
533
534 client.placeholder
535 Ignored (present for i3 compatibility).
536
537 client.unfocused
538 A view that does not have focus.
539
540 client.urgent
541 A view with an urgency hint. Note: Native Wayland windows do
542 not support urgency. Urgency only works for Xwayland windows.
543
544 The meaning of each color is:
545
546 border
547 The border around the title bar.
548
549 background
550 The background of the title bar.
551
552 text
553 The text color of the title bar.
554
555 indicator
556 The color used to indicate where a new view will open. In a
557 tiled container, this would paint the right border of the cur‐
558 rent view if a new view would be opened to the right.
559
560 child_border
561 The border around the view itself.
562
563 The default colors are:
564
565 ┌──────────────┬─────────┬────────────┬─────────┬───────────┬────────────┐
566 │ class │ border │ background │ text │ indicator │ child_bor‐ │
567 │ │ │ │ │ │ der │
568 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
569 │background │ n/a │ #ffffff │ n/a │ n/a │ n/a │
570 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
571 │focused │ #4c7899 │ #285577 │ #ffffff │ #2e9ef4 │ #285577 │
572 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
573 │focused_in‐ │ #333333 │ #5f676a │ #ffffff │ #484e50 │ #5f676a │
574 │active │ │ │ │ │ │
575 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
576 │fo‐ │ #333333 │ #5f676a │ #ffffff │ n/a │ n/a │
577 │cused_tab_ti‐ │ │ │ │ │ │
578 │tle │ │ │ │ │ │
579 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
580 │unfocused │ #333333 │ #222222 │ #888888 │ #292d2e │ #222222 │
581 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
582 │urgent │ #2f343a │ #900000 │ #ffffff │ #900000 │ #900000 │
583 ├──────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
584 │placeholder │ #000000 │ #0c0c0c │ #ffffff │ #000000 │ #0c0c0c │
585 └──────────────┴─────────┴────────────┴─────────┴───────────┴────────────┘
586
587 default_border normal|none|pixel [<n>]
588 Set default border style for new tiled windows.
589
590 default_floating_border normal|none|pixel [<n>]
591 Set default border style for new floating windows. This only ap‐
592 plies to windows that are spawned in floating mode, not windows
593 that become floating afterwards.
594
595 exec <shell command>
596 Executes shell command with sh.
597
598 exec_always <shell command>
599 Like exec, but the shell command will be executed again after
600 reload.
601
602 floating_maximum_size <width> x <height>
603 Specifies the maximum size of floating windows. -1 x -1 removes the
604 upper limit. The default is 0 x 0, which will use the width and
605 height of the entire output layout as the maximums
606
607 floating_minimum_size <width> x <height>
608 Specifies the minimum size of floating windows. The default is 75 x
609 50.
610
611 floating_modifier <modifier> [normal|inverse]
612 When the modifier key is held down, you may hold left click to move
613 windows, and right click to resize them. Setting modifier to none
614 disables this feature. If inverse is specified, left click is used
615 for resizing and right click for moving.
616
617 focus_follows_mouse yes|no|always
618 If set to yes, moving your mouse over a window will focus that win‐
619 dow. If set to always, the window under the cursor will always be
620 focused, even after switching between workspaces.
621
622 focus_on_window_activation smart|urgent|focus|none
623 This option determines what to do when an xwayland client requests
624 window activation. If set to urgent, the urgent state will be set
625 for that window. If set to focus, the window will become focused.
626 If set to smart, the window will become focused only if it is al‐
627 ready visible, otherwise the urgent state will be set. Default is
628 urgent.
629
630 focus_wrapping yes|no|force|workspace
631 This option determines what to do when attempting to focus over the
632 edge of a container. If set to no, the focused container will re‐
633 tain focus, if there are no other containers in the direction. If
634 set to yes, focus will be wrapped to the opposite edge of the con‐
635 tainer, if there are no other containers in the direction. If set
636 to force, focus will be wrapped to the opposite edge of the con‐
637 tainer, even if there are other containers in the direction. If set
638 to workspace, focus will wrap like in the yes case and additionally
639 wrap when moving outside of workspaces boundaries. Default is yes.
640
641 font [pango:]<font>
642 Sets font to use for the title bars. To enable support for pango
643 markup, preface the font name with pango:. For example, monospace
644 10 is the default font. To enable support for pango markup,
645 pango:monospace 10 should be used instead. Regardless of whether
646 pango markup is enabled, font should be specified as a pango font
647 description. For more information on pango font descriptions, see
648 https://docs.gtk.org/Pango/type_func.FontDescrip‐
649 tion.from_string.html#description
650
651 force_display_urgency_hint <timeout> [ms]
652 If an application on another workspace sets an urgency hint,
653 switching to this workspace may lead to immediate focus of the ap‐
654 plication, which also means the window decoration color would be
655 immediately reset to client.focused. This may make it unnecessarily
656 hard to tell which window originally raised the event. This option
657 allows one to set a timeout in ms to delay the urgency hint reset.
658
659 titlebar_border_thickness <thickness>
660 Thickness of the titlebar border in pixels
661
662 titlebar_padding <horizontal> [<vertical>]
663 Padding of the text in the titlebar. horizontal value affects hori‐
664 zontal padding of the text while vertical value affects vertical
665 padding (space above and below text). Padding includes titlebar
666 borders so their value should be greater than titlebar_bor‐
667 der_thickness. If vertical value is not specified it is set to the
668 horizontal value.
669
670 for_window <criteria> <command>
671 Whenever a window that matches criteria appears, run list of com‐
672 mands. See CRITERIA for more details.
673
674 gaps inner|outer|horizontal|vertical|top|right|bottom|left <amount>
675 Sets default amount pixels of inner or outer gap, where the inner
676 affects spacing around each view and outer affects the spacing
677 around each workspace. Outer gaps are in addition to inner gaps. To
678 reduce or remove outer gaps, outer gaps can be set to a negative
679 value. outer gaps can also be specified per side with top, right,
680 bottom, and left or per direction with horizontal and vertical.
681
682 This affects new workspaces only, and is used when the workspace
683 doesn't have its own gaps settings (see: workspace <ws> gaps ...).
684
685 hide_edge_borders [--i3] none|vertical|horizon‐
686 tal|both|smart|smart_no_gaps
687 Hides window borders adjacent to the screen edges. Default is none.
688 The --i3 option enables i3-compatible behavior to hide the title
689 bar on tabbed and stacked containers with one child. The
690 smart|smart_no_gaps options are equivalent to setting smart_borders
691 smart|no_gaps and hide_edge_borders none.
692
693 input <input_device> <input-subcommands...>
694 For details on input subcommands, see sway-input(5).
695
696 * may be used in lieu of a specific device name to configure all
697 input devices. A list of input device names may be obtained via
698 swaymsg -t get_inputs.
699
700 seat <seat> <seat-subcommands...>
701 For details on seat subcommands, see sway-input(5).
702
703 kill
704 Kills (closes) the currently focused container and all of its chil‐
705 dren.
706
707 smart_borders on|no_gaps|off
708 If smart_borders are on, borders will only be enabled if the
709 workspace has more than one visible child. If smart_borders is set
710 to no_gaps, borders will only be enabled if the workspace has more
711 than one visible child and gaps equal to zero.
712
713 smart_gaps on|off|toggle|inverse_outer
714 If smart_gaps are on gaps will only be enabled if a workspace has
715 more than one child. If smart_gaps are inverse_outer outer gaps
716 will only be enabled if a workspace has exactly one child.
717
718 mark --add|--replace [--toggle] <identifier>
719 Marks are arbitrary labels that can be used to identify certain
720 windows and then jump to them at a later time. Each identifier can
721 only be set on a single window at a time since they act as a unique
722 identifier. By default, mark sets identifier as the only mark on a
723 window. --add will instead add identifier to the list of current
724 marks for that window. If --toggle is specified mark will remove
725 identifier if it is already marked.
726
727 mode <mode>
728 Switches to the specified mode. The default mode is default.
729
730 mode [--pango_markup] <mode> <mode-subcommands...>
731 The only valid mode-subcommands... are bindsym, bindcode,
732 bindswitch, and set. If --pango_markup is given, then mode will be
733 interpreted as pango markup.
734
735 mouse_warping output|container|none
736 If output is specified, the mouse will be moved to new outputs as
737 you move focus between them. If container is specified, the mouse
738 will be moved to the middle of the container on switch. Default is
739 output.
740
741 no_focus <criteria>
742 Prevents windows matching <criteria> from being focused automati‐
743 cally when they're created. This has no effect on the first window
744 in a workspace.
745
746 output <output_name> <output-subcommands...>
747 For details on output subcommands, see sway-output(5).
748
749 * may be used in lieu of a specific output name to configure all
750 outputs. A list of output names may be obtained via swaymsg -t
751 get_outputs.
752
753 popup_during_fullscreen smart|ignore|leave_fullscreen
754 Determines what to do when a fullscreen view opens a dialog. If
755 smart (the default), the dialog will be displayed. If ignore, the
756 dialog will not be rendered. If leave_fullscreen, the view will
757 exit fullscreen mode and the dialog will be rendered.
758
759 set $<name> <value>
760 Sets variable $name to value. You can use the new variable in the
761 arguments of future commands. When the variable is used, it can be
762 escaped with an additional $ (ie $$name) to have the replacement
763 happen at run time instead of when reading the config. However, it
764 does not always make sense for the variable to be replaced at run
765 time since some arguments do need to be known at config time.
766
767 show_marks yes|no
768 If show_marks is yes, marks will be displayed in the window bor‐
769 ders. Any mark that starts with an underscore will not be drawn
770 even if show_marks is yes. The default is yes.
771
772 opacity [set|plus|minus] <value>
773 Adjusts the opacity of the window between 0 (completely transpar‐
774 ent) and 1 (completely opaque). If the operation is omitted, set
775 will be used.
776
777 tiling_drag enable|disable|toggle
778 Sets whether or not tiling containers can be dragged with the
779 mouse. If enabled (default), the floating_mod can be used to drag
780 tiling, as well as floating, containers. Using the left mouse but‐
781 ton on title bars without the floating_mod will also allow the con‐
782 tainer to be dragged. toggle should not be used in the config file.
783
784 tiling_drag_threshold <threshold>
785 Sets the threshold that must be exceeded for a container to be
786 dragged by its titlebar. This has no effect if floating_mod is used
787 or if tiling_drag is set to disable. Once the threshold has been
788 exceeded once, the drag starts and the cursor can come back inside
789 the threshold without stopping the drag. threshold is multiplied
790 by the scale of the output that the cursor on. The default is 9.
791
792 title_align left|center|right
793 Sets the title alignment. If right is selected and show_marks is
794 set to yes, the marks will be shown on the left side instead of the
795 right side.
796
797 unbindswitch <switch>:<state>
798 Removes a binding for when <switch> changes to <state>.
799
800 unbindsym [--whole-window] [--border] [--exclude-titlebar] [--release]
801 [--locked] [--to-code] [--input-device=<device>] <key combo>
802 Removes the binding for key combo that was previously bound with
803 the given flags. If input-device is given, only the binding for
804 that input device will be unbound.
805
806 unbindcode [--whole-window] [--border] [--exclude-titlebar] [--re‐
807 lease] [--locked] [--input-device=<device>] <code> is also avail‐
808 able for unbinding with key/button codes instead of key/button
809 names.
810
811 unmark [<identifier>]
812 unmark will remove identifier from the list of current marks on a
813 window. If identifier is omitted, all marks are removed.
814
815 urgent enable|disable|allow|deny
816 Using enable or disable manually sets or unsets the window's urgent
817 state. Using allow or deny controls the window's ability to set it‐
818 self as urgent. By default, windows are allowed to set their own
819 urgency.
820
821 workspace [--no-auto-back-and-forth] [number] <[num:]name>
822 Switches to the specified workspace. The num: portion of the name
823 is optional and will be used for ordering. If num: is not given and
824 name is a number, then it will be also be used for ordering.
825
826 If the no-auto-back-and-forth option is given, then this command
827 will not perform a back-and-forth operation when the workspace is
828 already focused and workspace_auto_back_and_forth is enabled.
829
830 If the number keyword is specified and a workspace with the number
831 already exists, then the workspace with the number will be used. If
832 a workspace with the number does not exist, a new workspace will be
833 created with the name name.
834
835 workspace prev|next
836 Switches to the next workspace on the current output or on the next
837 output if currently on the last workspace.
838
839 workspace prev_on_output|next_on_output
840 Switches to the next workspace on the current output.
841
842 workspace back_and_forth
843 Switches to the previously focused workspace.
844
845 workspace <name> gaps inner|outer|horizontal|vertical|top|right|bot‐
846 tom|left <amount>
847 Specifies that workspace name should have the given gaps settings
848 when it is created.
849
850 This command does not affect existing workspaces. To alter the gaps
851 of an existing workspace, use the gaps command.
852
853 workspace <name> output <outputs...>
854 Specifies that workspace name should be shown on the specified out‐
855 puts. Multiple outputs can be listed and the first available will
856 be used. If the workspace gets placed on an output further down the
857 list and an output that is higher on the list becomes available,
858 the workspace will be moved to the higher priority output.
859
860 This command does not affect existing workspaces. To move an exist‐
861 ing workspace, use the move command in combination with the
862 workspace criteria (non-empty workspaces only) or workspace command
863 (to switch to the workspace before moving).
864
865 workspace_auto_back_and_forth yes|no
866 When yes, repeating a workspace switch command will switch back to
867 the prior workspace. For example, if you are currently on workspace
868 1, switch to workspace 2, then invoke the workspace 2 command
869 again, you will be returned to workspace 1. Default is no.
870
872 A criteria is a string in the form of, for example:
873
874 [class="[Rr]egex.*" title="some title"]
875
876 The string contains one or more (space separated) attribute/value
877 pairs. They are used by some commands to choose which views to execute
878 actions on. All attributes must match for the criteria to match. Crite‐
879 ria is retained across commands separated by a ,, but will be reset
880 (and allow for new criteria, if desired) for commands separated by a ;.
881
882 Criteria may be used with either the for_window or assign commands to
883 specify operations to perform on new views. A criteria may also be used
884 to perform specific commands (ones that normally act upon one window)
885 on all views that match that criteria. For example:
886
887 Focus on a window with the mark "IRC":
888
889 [con_mark="IRC"] focus
890
891 Kill all windows with the title "Emacs":
892
893 [class="Emacs"] kill
894
895 You may like to use swaymsg -t get_tree for finding the values of these
896 properties in practice for your applications.
897
898 The following attributes may be matched with:
899
900 app_id
901 Compare value against the app id. Can be a regular expression. If
902 value is __focused__, then the app id must be the same as that of
903 the currently focused window. app_id are specific to Wayland appli‐
904 cations.
905
906 class
907 Compare value against the window class. Can be a regular expres‐
908 sion. If value is __focused__, then the window class must be the
909 same as that of the currently focused window. class are specific to
910 X11 applications.
911
912 con_id
913 Compare against the internal container ID, which you can find via
914 IPC. If value is __focused__, then the id must be the same as that
915 of the currently focused window.
916
917 con_mark
918 Compare against the window marks. Can be a regular expression.
919
920 floating
921 Matches floating windows.
922
923 id
924 Compare value against the X11 window ID. Must be numeric.
925
926 instance
927 Compare value against the window instance. Can be a regular expres‐
928 sion. If value is __focused__, then the window instance must be the
929 same as that of the currently focused window.
930
931 pid
932 Compare value against the window's process ID. Must be numeric.
933
934 shell
935 Compare value against the window shell, such as "xdg_shell" or
936 "xwayland". Can be a regular expression. If value is __focused__,
937 then the shell must be the same as that of the currently focused
938 window.
939
940 tiling
941 Matches tiling windows.
942
943 title
944 Compare against the window title. Can be a regular expression. If
945 value is __focused__, then the window title must be the same as
946 that of the currently focused window.
947
948 urgent
949 Compares the urgent state of the window. Can be first, last, lat‐
950 est, newest, oldest or recent.
951
952 window_role
953 Compare against the window role (WM_WINDOW_ROLE). Can be a regular
954 expression. If value is __focused__, then the window role must be
955 the same as that of the currently focused window.
956
957 window_type
958 Compare against the window type (_NET_WM_WINDOW_TYPE). Possible
959 values are normal, dialog, utility, toolbar, splash, menu, drop‐
960 down_menu, popup_menu, tooltip and notification.
961
962 workspace
963 Compare against the workspace name for this view. Can be a regular
964 expression. If the value is __focused__, then all the views on the
965 currently focused workspace matches.
966
968 sway(1) sway-input(5) sway-output(5) sway-bar(5) sway-ipc(7)
969
970
971
972 2022-11-14 sway(5)