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