1sway(5)                       File Formats Manual                      sway(5)
2
3
4

NAME

6       sway - configuration file and commands
7

DESCRIPTION

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

COMMAND CONVENTIONS

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

COMMANDS

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 <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|ptt]
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|toggle|t
337           Splits the current container, vertically or horizontally. When tog‐
338           gle is specified, the current container is split opposite to the
339           parent container's layout.
340
341       splith
342           Equivalent to split horizontal
343
344       splitv
345           Equivalent to split vertical
346
347       splitt
348           Equivalent to split toggle
349
350       sticky enable|disable|toggle
351           "Sticks" a floating window to the current output so that it shows
352           up on all workspaces.
353
354       swap container with id|con_id|mark <arg>
355           Swaps the position, geometry, and fullscreen status of two contain‐
356           ers. The first container can be selected either by criteria or fo‐
357           cus. The second container can be selected by id, con_id, or mark.
358           id can only be used with xwayland views. If the first container has
359           focus, it will retain focus unless it is moved to a different
360           workspace or the second container becomes fullscreen on the same
361           workspace as the first container. In either of those cases, the
362           second container will gain focus.
363
364       title_format <format>
365           Sets the format of window titles. The following placeholders may be
366           used:
367
368               %title - The title supplied by the window
369                         %app_id - The wayland app ID (applicable to wayland
370               windows only)
371                         %class - The X11 classname (applicable to xwayland
372               windows only)
373                         %instance - The X11 instance (applicable to xwayland
374               windows only)
375                         %shell - The protocol the window is using (typically
376               xwayland or
377                   xdg_shell)
378
379           This command is typically used with for_window criteria. For exam‐
380           ple:
381
382               for_window [title="."] title_format "<b>%title</b> (%app_id)"
383
384           Note that markup requires pango to be enabled via the font command.
385
386           The default format is "%title".
387
388       The following commands may be used either in the configuration file or
389       at runtime.
390
391       assign <criteria> [→] [workspace] [number] <workspace>
392           Assigns views matching criteria (see CRITERIA for details) to
393           workspace. The → (U+2192) is optional and cosmetic. This command is
394           equivalent to:
395
396               for_window <criteria> move container to workspace <workspace>
397
398       assign <criteria> [→] output left|right|up|down|<name>
399           Assigns views matching criteria (see CRITERIA for details) to the
400           specified output. The → (U+2192) is optional and cosmetic. This
401           command is equivalent to:
402
403               for_window <criteria> move container to output <output>
404
405       bindsym [--whole-window] [--border] [--exclude-titlebar] [--release]
406       [--locked] [--to-code] [--input-device=<device>] [--no-warn] [--no-re‐
407       peat] [Group<1-4>+]<key combo> <command>
408           Binds key combo to execute the sway command command when pressed.
409           You may use XKB key names here (wev(1) is a good tool for discover‐
410           ing these). With the flag --release, the command is executed when
411           the key combo is released. If input-device is given, the binding
412           will only be executed for that input device and will be executed
413           instead of any binding that is generic to all devices. If a group
414           number is given, then the binding will only be available for that
415           group. By default, if you overwrite a binding, swaynag will give
416           you a warning. To silence this, use the --no-warn flag.
417
418           Unless the flag --locked is set, the command will not be run when a
419           screen locking program is active. If there is a matching binding
420           with and without --locked, the one with will be preferred when
421           locked and the one without will be preferred when unlocked. If
422           there are matching bindings and one has both --input-device and
423           --locked and the other has neither, the former will be preferred
424           even when unlocked.
425
426           Unless the flag --inhibited is set, the command will not be run
427           when a keyboard shortcuts inhibitor is active for the currently fo‐
428           cused window. Such inhibitors are usually requested by remote desk‐
429           top and virtualization software to enable the user to send keyboard
430           shortcuts to the remote or virtual session. The --inhibited flag
431           allows to define bindings which will be exempt from pass-through to
432           such software. The same preference logic as for --locked applies.
433
434           Unless the flag --no-repeat is set, the command will be run repeat‐
435           edly when the key is held, according to the repeat settings speci‐
436           fied in the input configuration.
437
438           Bindings to keysyms are layout-dependent. This can be changed with
439           the --to-code flag. In this case, the keysyms will be translated
440           into the corresponding keycodes in the first configured layout.
441
442           Mouse bindings operate on the container under the cursor instead of
443           the container that has focus. Mouse buttons can either be specified
444           in the form button[1-9] or by using the name of the event code (ex
445           BTN_LEFT or BTN_RIGHT). For the former option, the buttons will be
446           mapped to their values in X11 (1=left, 2=middle, 3=right, 4=scroll
447           up, 5=scroll down, 6=scroll left, 7=scroll right, 8=back, 9=for‐
448           ward). For the latter option, you can find the event names using
449           libinput debug-events.
450
451           The priority for matching bindings is as follows: input device,
452           group, and locked state.
453
454           --whole-window, --border, and --exclude-titlebar are mouse-only op‐
455           tions which affect the region in which the mouse bindings can be
456           triggered.  By default, mouse bindings are only triggered when over
457           the title bar. With the --border option, the border of the window
458           will be included in this region. With the --whole-window option,
459           the cursor can be anywhere over a window including the title, bor‐
460           der, and content. --exclude-titlebar can be used in conjunction
461           with any other option to specify that the titlebar should be ex‐
462           cluded from the region of consideration.
463
464           If --whole-window is given, the command can be triggered when the
465           cursor is over an empty workspace. Using a mouse binding over a
466           layer surface's exclusive region is not currently possible.
467
468           Example:
469                     # Execute firefox when alt, shift, and f are pressed together
470                     bindsym Mod1+Shift+f exec firefox
471
472           bindcode [--whole-window] [--border] [--exclude-titlebar] [--re‐
473           lease] [--locked] [--input-device=<device>] [--no-warn]
474           [Group<1-4>+]<code> <command> is also available for binding with
475           key/button codes instead of key/button names.
476
477       bindswitch [--locked] [--no-warn] [--reload] <switch>:<state> <command>
478           Binds <switch> to execute the sway command command on state
479           changes. Supported switches are lid (laptop lid) and tablet (tablet
480           mode) switches. Valid values for state are on, off and toggle.
481           These switches are on when the device lid is shut and when tablet
482           mode is active respectively. toggle is also supported to run a com‐
483           mand both when the switch is toggled on or off.
484
485           Unless the flag --locked is set, the command will not be run when a
486           screen locking program is active. If there is a matching binding
487           with and without --locked, the one with will be preferred when
488           locked and the one without will be preferred when unlocked.
489
490           If the --reload flag is given, the binding will also be executed
491           when the config is reloaded. toggle bindings will not be executed
492           on reload. The --locked flag will operate as normal so if the con‐
493           fig is reloaded while locked and --locked is not given, the binding
494           will not be executed.
495
496           By default, if you overwrite a binding, swaynag will give you a
497           warning. To silence this, use the --no-warn flag.
498
499           Example:
500                     # Show the virtual keyboard when tablet mode is entered.
501                     bindswitch tablet:on busctl call --user sm.puri.OSK0 /sm/puri/OSK0 sm.puri.OSK0 SetVisible b true
502
503                     # Log a message when the laptop lid is opened or closed.
504                     bindswitch lid:toggle exec echo "Lid moved"
505
506       client.background <color>
507           This command is ignored and is only present for i3 compatibility.
508
509       client.<class> <border> <background> <text> [<indicator> [<child_bor‐
510       der>]]
511           Configures the color of window borders and title bars. The first
512           three colors are required. When omitted indicator will use a sane
513           default and child_border will use the color set for background.
514           Colors may be specified in hex, either as #RRGGBB or #RRGGBBAA.
515
516           The available classes are:
517
518           client.focused
519               The window that has focus.
520
521           client.focused_inactive
522               The most recently focused view within a container which is not
523               focused.
524
525           client.placeholder
526               Ignored (present for i3 compatibility).
527
528           client.unfocused
529               A view that does not have focus.
530
531           client.urgent
532               A view with an urgency hint. Note: Native Wayland windows do
533               not support urgency. Urgency only works for Xwayland windows.
534
535           The meaning of each color is:
536
537           border
538               The border around the title bar.
539
540           background
541               The background of the title bar.
542
543           text
544               The text color of the title bar.
545
546           indicator
547               The color used to indicate where a new view will open. In a
548               tiled container, this would paint the right border of the cur‐
549               rent view if a new view would be opened to the right.
550
551           child_border
552               The border around the view itself.
553
554       The default colors are:
555
556       ┌────────────┬─────────┬────────────┬─────────┬───────────┬────────────┐
557class    borderbackgroundtextindicatorchild_bor‐
558       │            │         │            │         │           │ der
559       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
560background  │ n/a     │ #ffffff    │ n/a     │ n/a       │ n/a        │
561       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
562focused     │ #4c7899 │ #285577    │ #ffffff │ #2e9ef4   │ #285577    │
563       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
564focused_in‐ │ #333333 │ #5f676a    │ #ffffff │ #484e50   │ #5f676a    │
565active      │         │            │         │           │            │
566       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
567unfocused   │ #333333 │ #222222    │ #888888 │ #292d2e   │ #222222    │
568       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
569urgent      │ #2f343a │ #900000    │ #ffffff │ #900000   │ #900000    │
570       ├────────────┼─────────┼────────────┼─────────┼───────────┼────────────┤
571placeholder │ #000000 │ #0c0c0c    │ #ffffff │ #000000   │ #0c0c0c    │
572       └────────────┴─────────┴────────────┴─────────┴───────────┴────────────┘
573
574       default_border normal|none|pixel [<n>]
575           Set default border style for new tiled windows.
576
577       default_floating_border normal|none|pixel [<n>]
578           Set default border style for new floating windows. This only ap‐
579           plies to windows that are spawned in floating mode, not windows
580           that become floating afterwards.
581
582       exec <shell command>
583           Executes shell command with sh.
584
585       exec_always <shell command>
586           Like exec, but the shell command will be executed again after
587           reload.
588
589       floating_maximum_size <width> x <height>
590           Specifies the maximum size of floating windows. -1 x -1 removes the
591           upper limit. The default is 0 x 0, which will use the width and
592           height of the entire output layout as the maximums
593
594       floating_minimum_size <width> x <height>
595           Specifies the minimum size of floating windows. The default is 75 x
596           50.
597
598       floating_modifier <modifier> [normal|inverse]
599           When the modifier key is held down, you may hold left click to move
600           windows, and right click to resize them. Setting modifier to none
601           disables this feature. If inverse is specified, left click is used
602           for resizing and right click for moving.
603
604       focus_follows_mouse yes|no|always
605           If set to yes, moving your mouse over a window will focus that win‐
606           dow. If set to always, the window under the cursor will always be
607           focused, even after switching between workspaces.
608
609       focus_on_window_activation smart|urgent|focus|none
610           This option determines what to do when an xwayland client requests
611           window activation. If set to urgent, the urgent state will be set
612           for that window. If set to focus, the window will become focused.
613           If set to smart, the window will become focused only if it is al‐
614           ready visible, otherwise the urgent state will be set. Default is
615           urgent.
616
617       focus_wrapping yes|no|force|workspace
618           This option determines what to do when attempting to focus over the
619           edge of a container. If set to no, the focused container will re‐
620           tain focus, if there are no other containers in the direction. If
621           set to yes, focus will be wrapped to the opposite edge of the con‐
622           tainer, if there are no other containers in the direction. If set
623           to force, focus will be wrapped to the opposite edge of the con‐
624           tainer, even if there are other containers in the direction. If set
625           to workspace, focus will wrap like in the yes case and additionally
626           wrap when moving outside of workspaces boundaries. Default is yes.
627
628       font [pango:]<font>
629           Sets font to use for the title bars. To enable support for pango
630           markup, preface the font name with pango:. For example, monospace
631           10 is the default font. To enable support for pango markup,
632           pango:monospace 10 should be used instead. Regardless of whether
633           pango markup is enabled, font should be specified as a pango font
634           description. For more information on pango font descriptions, see
635           https://developer.gnome.org/pango/stable/pango-Fonts.html#pango-
636           font-description-from-string
637
638       force_display_urgency_hint <timeout> [ms]
639           If an application on another workspace sets an urgency hint,
640           switching to this workspace may lead to immediate focus of the ap‐
641           plication, which also means the window decoration color would be
642           immediately resetted to client.focused. This may make it unneces‐
643           sarily hard to tell which window originally raised the event. This
644           option allows to set a timeout in ms to delay the urgency hint re‐
645           set.
646
647       titlebar_border_thickness <thickness>
648           Thickness of the titlebar border in pixels
649
650       titlebar_padding <horizontal> [<vertical>]
651           Padding of the text in the titlebar. horizontal value affects hori‐
652           zontal padding of the text while vertical value affects vertical
653           padding (space above and below text). Padding includes titlebar
654           borders so their value should be greater than titlebar_bor‐
655           der_thickness. If vertical value is not specified it is set to the
656           horizontal value.
657
658       for_window <criteria> <command>
659           Whenever a window that matches criteria appears, run list of com‐
660           mands. See CRITERIA for more details.
661
662       gaps inner|outer|horizontal|vertical|top|right|bottom|left <amount>
663           Sets default amount pixels of inner or outer gap, where the inner
664           affects spacing around each view and outer affects the spacing
665           around each workspace. Outer gaps are in addition to inner gaps. To
666           reduce or remove outer gaps, outer gaps can be set to a negative
667           value. outer gaps can also be specified per side with top, right,
668           bottom, and left or per direction with horizontal and vertical.
669
670           This affects new workspaces only, and is used when the workspace
671           doesn't have its own gaps settings (see: workspace <ws> gaps ...).
672
673       hide_edge_borders [--i3] none|vertical|horizon‐
674       tal|both|smart|smart_no_gaps
675           Hides window borders adjacent to the screen edges. Default is none.
676           The --i3 option enables i3-compatible behavior to hide the title
677           bar on tabbed and stacked containers with one child. The
678           smart|smart_no_gaps options are equivalent to setting smart_borders
679           smart|no_gaps and hide_edge_borders none.
680
681       input <input_device> <input-subcommands...>
682           For details on input subcommands, see sway-input(5).
683
684           * may be used in lieu of a specific device name to configure all
685           input devices. A list of input device names may be obtained via
686           swaymsg -t get_inputs.
687
688       seat <seat> <seat-subcommands...>
689           For details on seat subcommands, see sway-input(5).
690
691       kill
692           Kills (closes) the currently focused container and all of its chil‐
693           dren.
694
695       smart_borders on|no_gaps|off
696           If smart_borders are on, borders will only be enabled if the
697           workspace has more than one visible child. If smart_borders is set
698           to no_gaps, borders will only be enabled if the workspace has more
699           than one visible child and gaps equal to zero.
700
701       smart_gaps on|off
702           If smart_gaps are on gaps will only be enabled if a workspace has
703           more than one child.
704
705       mark --add|--replace [--toggle] <identifier>
706           Marks are arbitrary labels that can be used to identify certain
707           windows and then jump to them at a later time. Each identifier can
708           only be set on a single window at a time since they act as a unique
709           identifier. By default, mark sets identifier as the only mark on a
710           window. --add will instead add identifier to the list of current
711           marks for that window. If --toggle is specified mark will remove
712           identifier if it is already marked.
713
714       mode <mode>
715           Switches to the specified mode. The default mode is default.
716
717       mode [--pango_markup] <mode> <mode-subcommands...>
718           The only valid mode-subcommands... are bindsym, bindcode,
719           bindswitch, and set. If --pango_markup is given, then mode will be
720           interpreted as pango markup.
721
722       mouse_warping output|container|none
723           If output is specified, the mouse will be moved to new outputs as
724           you move focus between them. If container is specified, the mouse
725           will be moved to the middle of the container on switch. Default is
726           output.
727
728       no_focus <criteria>
729           Prevents windows matching <criteria> from being focused automati‐
730           cally when they're created. This has no effect on the first window
731           in a workspace.
732
733       output <output_name> <output-subcommands...>
734           For details on output subcommands, see sway-output(5).
735
736           * may be used in lieu of a specific output name to configure all
737           outputs. A list of output names may be obtained via swaymsg -t
738           get_outputs.
739
740       popup_during_fullscreen smart|ignore|leave_fullscreen
741           Determines what to do when a fullscreen view opens a dialog. If
742           smart (the default), the dialog will be displayed. If ignore, the
743           dialog will not be rendered. If leave_fullscreen, the view will
744           exit fullscreen mode and the dialog will be rendered.
745
746       set $<name> <value>
747           Sets variable $name to value. You can use the new variable in the
748           arguments of future commands. When the variable is used, it can be
749           escaped with an additional $ (ie $$name) to have the replacement
750           happen at run time instead of when reading the config. However, it
751           does not always make sense for the variable to be replaced at run
752           time since some arguments do need to be known at config time.
753
754       show_marks yes|no
755           If show_marks is yes, marks will be displayed in the window bor‐
756           ders. Any mark that starts with an underscore will not be drawn
757           even if show_marks is yes. The default is yes.
758
759       opacity [set|plus|minus] <value>
760           Adjusts the opacity of the window between 0 (completely transpar‐
761           ent) and 1 (completely opaque). If the operation is omitted, set
762           will be used.
763
764       tiling_drag  enable|disable|toggle
765           Sets whether or not tiling containers can be dragged with the
766           mouse. If enabled (default), the floating_mod can be used to drag
767           tiling, as well as floating, containers. Using the left mouse but‐
768           ton on title bars without the floating_mod will also allow the con‐
769           tainer to be dragged. toggle should not be used in the config file.
770
771       tiling_drag_threshold <threshold>
772           Sets the threshold that must be exceeded for a container to be
773           dragged by its titlebar. This has no effect if floating_mod is used
774           or if tiling_drag is set to disable.  Once the threshold has been
775           exceeded once, the drag starts and the cursor can come back inside
776           the threshold without stopping the drag.  threshold is multiplied
777           by the scale of the output that the cursor on.  The default is 9.
778
779       title_align left|center|right
780           Sets the title alignment. If right is selected and show_marks is
781           set to yes, the marks will be shown on the left side instead of the
782           right side.
783
784       unbindswitch <switch>:<state>
785           Removes a binding for when <switch> changes to <state>.
786
787       unbindsym [--whole-window] [--border] [--exclude-titlebar] [--release]
788       [--locked] [--to-code] [--input-device=<device>] <key combo>
789           Removes the binding for key combo that was previously bound with
790           the given flags.  If input-device is given, only the binding for
791           that input device will be unbound.
792
793           unbindcode [--whole-window] [--border] [--exclude-titlebar] [--re‐
794           lease] [--locked] [--input-device=<device>] <code> is also avail‐
795           able for unbinding with key/button codes instead of key/button
796           names.
797
798       unmark [<identifier>]
799           unmark will remove identifier from the list of current marks on a
800           window. If identifier is omitted, all marks are removed.
801
802       urgent enable|disable|allow|deny
803           Using enable or disable manually sets or unsets the window's urgent
804           state. Using allow or deny controls the window's ability to set it‐
805           self as urgent. By default, windows are allowed to set their own
806           urgency.
807
808       workspace [--no-auto-back-and-forth] [number] <[num:]name>
809           Switches to the specified workspace. The num: portion of the name
810           is optional and will be used for ordering. If num: is not given and
811           name is a number, then it will be also be used for ordering.
812
813           If the no-auto-back-and-forth option is given, then this command
814           will not perform a back-and-forth operation when the workspace is
815           already focused and workspace_auto_back_and_forth is enabled.
816
817           If the number keyword is specified and a workspace with the number
818           already exists, then the workspace with the number will be used. If
819           a workspace with the number does not exist, a new workspace will be
820           created with the name name.
821
822       workspace prev|next
823           Switches to the next workspace on the current output or on the next
824           output if currently on the last workspace.
825
826       workspace prev_on_output|next_on_output
827           Switches to the next workspace on the current output.
828
829       workspace back_and_forth
830           Switches to the previously focused workspace.
831
832       workspace <name> gaps inner|outer|horizontal|vertical|top|right|bot‐
833       tom|left <amount>
834           Specifies that workspace name should have the given gaps settings
835           when it is created.
836
837           This command does not affect existing workspaces. To alter the gaps
838           of an existing workspace, use the gaps command.
839
840       workspace <name> output <outputs...>
841           Specifies that workspace name should be shown on the specified out‐
842           puts. Multiple outputs can be listed and the first available will
843           be used. If the workspace gets placed on an output further down the
844           list and an output that is higher on the list becomes available,
845           the workspace will be moved to the higher priority output.
846
847           This command does not affect existing workspaces. To move an exist‐
848           ing workspace, use the move command in combination with the
849           workspace criteria (non-empty workspaces only) or workspace command
850           (to switch to the workspace before moving).
851
852       workspace_auto_back_and_forth yes|no
853           When yes, repeating a workspace switch command will switch back to
854           the prior workspace. For example, if you are currently on workspace
855           1, switch to workspace 2, then invoke the workspace 2 command
856           again, you will be returned to workspace 1. Default is no.
857

CRITERIA

859       A criteria is a string in the form of, for example:
860
861           [class="[Rr]egex.*" title="some title"]
862
863       The string contains one or more (space separated) attribute/value
864       pairs. They are used by some commands to choose which views to execute
865       actions on. All attributes must match for the criteria to match. Crite‐
866       ria is retained across commands separated by a ,, but will be reset
867       (and allow for new criteria, if desired) for commands separated by a ;.
868
869       Criteria may be used with either the for_window or assign commands to
870       specify operations to perform on new views. A criteria may also be used
871       to perform specific commands (ones that normally act upon one window)
872       on all views that match that criteria. For example:
873
874       Focus on a window with the mark "IRC":
875
876           [con_mark="IRC"] focus
877
878       Kill all windows with the title "Emacs":
879
880           [class="Emacs"] kill
881
882       You may like to use swaymsg -t get_tree for finding the values of these
883       properties in practice for your applications.
884
885       The following attributes may be matched with:
886
887       app_id
888           Compare value against the app id. Can be a regular expression. If
889           value is __focused__, then the app id must be the same as that of
890           the currently focused window. app_id are specific to Wayland appli‐
891           cations.
892
893       class
894           Compare value against the window class. Can be a regular expres‐
895           sion. If value is __focused__, then the window class must be the
896           same as that of the currently focused window. class are specific to
897           X11 applications.
898
899       con_id
900           Compare against the internal container ID, which you can find via
901           IPC. If value is __focused__, then the id must be the same as that
902           of the currently focused window.
903
904       con_mark
905           Compare against the window marks. Can be a regular expression.
906
907       floating
908           Matches floating windows.
909
910       id
911           Compare value against the X11 window ID. Must be numeric.
912
913       instance
914           Compare value against the window instance. Can be a regular expres‐
915           sion. If value is __focused__, then the window instance must be the
916           same as that of the currently focused window.
917
918       pid
919           Compare value against the window's process ID. Must be numeric.
920
921       shell
922           Compare value against the window shell, such as "xdg_shell" or
923           "xwayland". Can be a regular expression. If value is __focused__,
924           then the shell must be the same as that of the currently focused
925           window.
926
927       tiling
928           Matches tiling windows.
929
930       title
931           Compare against the window title. Can be a regular expression. If
932           value is __focused__, then the window title must be the same as
933           that of the currently focused window.
934
935       urgent
936           Compares the urgent state of the window. Can be first, last, lat‐
937           est, newest, oldest or recent.
938
939       window_role
940           Compare against the window role (WM_WINDOW_ROLE). Can be a regular
941           expression. If value is __focused__, then the window role must be
942           the same as that of the currently focused window.
943
944       window_type
945           Compare against the window type (_NET_WM_WINDOW_TYPE). Possible
946           values are normal, dialog, utility, toolbar, splash, menu, drop‐
947           down_menu, popup_menu, tooltip and notification.
948
949       workspace
950           Compare against the workspace name for this view. Can be a regular
951           expression. If the value is __focused__, then all the views on the
952           currently focused workspace matches.
953

SEE ALSO

955       sway(1) sway-input(5) sway-output(5) sway-bar(5) sway-ipc(7)
956
957
958
959                                  2021-07-23                           sway(5)
Impressum