aboutsummaryrefslogtreecommitdiffstats
path: root/sway/sway.5.scd
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-05-11 20:58:34 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2018-05-11 21:03:43 -0400
commit432256ad84af0b6ef62ff92fe3248d2ce8ceffd4 (patch)
tree066fa73134aa168f00d5403657371ce2b83921e5 /sway/sway.5.scd
parentWire up scdoc and rewrite sway(1) (diff)
downloadsway-432256ad84af0b6ef62ff92fe3248d2ce8ceffd4.tar.gz
sway-432256ad84af0b6ef62ff92fe3248d2ce8ceffd4.tar.zst
sway-432256ad84af0b6ef62ff92fe3248d2ce8ceffd4.zip
Add sway(5)
Diffstat (limited to 'sway/sway.5.scd')
-rw-r--r--sway/sway.5.scd578
1 files changed, 578 insertions, 0 deletions
diff --git a/sway/sway.5.scd b/sway/sway.5.scd
new file mode 100644
index 00000000..75f1bf9d
--- /dev/null
+++ b/sway/sway.5.scd
@@ -0,0 +1,578 @@
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
22These commands can be executed in your config file, via *swaymsg*(1), or via
23the bindsym command.
24
25# COMMAND CONVENTIONS
26
27Commands are split into several arguments using spaces. You can enclose
28arguments with quotation marks (*"..."* or *'...'*) to add spaces to a single
29argument. You may also run several commands in order by separating each with
30*,* or *;*.
31
32Throughout the documentation, *|* is used to distinguish between arguments for
33which you may only select one. *[...]* is used for optional arguments, and
34*<...>* for arguments where you are expected to supply some value.
35
36# COMMANDS
37
38The following commands may only be used in the configuration file.
39
40*bar {* <commands...> *}*
41 _commands..._ after *{* will be interpreted as bar commands. For
42 details, see *sway-bar*(5). A newline is required between *{* and the
43 first command, and *}* must be alone on a line.
44
45*default\_orientation* horizontal|vertical|auto
46 Sets the default container layout for tiled containers.
47
48*include* <path>
49 Includes another file from _path_. _path_ can be either a full path or a
50 path relative to the parent config, and expands shell syntax (see
51 *wordexp*(3) for details). The same include file can only be included once;
52 subsequent attempts will be ignored.
53
54*set* <name> <value>
55 Sets variable $_name_ to _value_. You can use the new variable in the
56 arguments of future commands.
57
58*swaybg\_command* <command>
59 Executes custom bg _command_. Default is _swaybg_. Refer to **output**
60 below for more information.
61
62The following commands cannot be used directly in the configuration file.
63They are expected to be used with *bindsym* or at runtime through *swaymsg*(1).
64
65*border* normal|pixel [<n>]
66 Set border style for focused window. _normal_ includes a border of
67 thickness _n_ and a title bar. _pixel_ is a border without title bar _n_
68 pixels thick. Default is _normal_ with border thickness 2.
69
70*border* none|toggle
71 Set border style for focused window to _none_ or _toggle_ between the
72 available border styles: _normal_, _pixel_, _none_.
73
74*exit*
75 Exit sway and end your Wayland session.
76
77*floating* enable|disable|toggle
78 Make focused view floating, non-floating, or the opposite of what it is now.
79
80*focus* up|right|down|left
81 Moves focus to the next container in the specified direction.
82
83*focus* child
84 Moves focus to the last-focused child of the focused container.
85
86*focus* parent
87 Moves focus to the parent of the focused container.
88
89*focus* output up|right|down|left
90 Moves focus to the next output in the specified direction.
91
92*focus* output <name>
93 Moves focus to the named output.
94
95*focus* mode\_toggle
96 Moves focus between the floating and tiled layers.
97
98*fullscreen*
99 Toggles fullscreen for the focused view.
100
101*layout* splith|splitv|stacking|tabbed
102 Sets the layout mode of the focused container.
103
104*layout* toggle split
105 Switches the focused container between the splitv and splith layouts.
106
107*move* left|right|up|down [<px>]
108 Moves the focused container in the direction specified. If the container,
109 the optional _px_ argument specifies how many pixels to move the container.
110 If unspecified, the default is 10 pixels. Pixels are ignored when moving
111 tiled containers.
112
113*move* container|window to workspace <name>
114 Moves the focused container to the specified workspace.
115
116*move* container|window to workspace prev|next
117 Moves the focused container to the previous or next workspace on this
118 output, or if no workspaces remain, the previous or next output.
119
120*move* container|window to workspace prev\_on\_output|next\_on\_output
121 Moves the focused container to the previous or next workspace on this
122 output, wrapping around if already at the first or last workspace.
123
124*move* container|window|workspace to output <name>
125 Moves the focused container or workspace to the specified output.
126
127*move* container|window|workspace to output up|right|down|left
128 Moves the focused container or workspace to next output in the specified
129 direction.
130
131*move* [to] scratchpad
132 Moves the focused window to the scratchpad.
133
134*reload*
135 Reloads the sway config file and applies any changes.
136
137*resize* shrink|grow width|height [<amount>] [px|ppt]
138 Resizes the currently focused container by _amount_, specified in pixels or
139 percentage points. If omitted, floating containers are resized in px and
140 tiled containers by ppt. If omitted, the default _amount_ is 10.
141
142*resize set* <width> [px] <height> [px]
143 Sets the width and height of the currently focused container to _width_
144 pixels and _height_ pixels. The [px] parameters are optional and have no
145 effect. This command only accepts a size in pixels. Width and height may be
146 specified in either order.
147
148*scratchpad show*
149 Shows a window from the scratchpad. Repeatedly using this command will
150 cycle through the windows in the scratchpad.
151
152*split* vertical|v|horizontal|h|toggle|t
153 Splits the current container, vertically or horizontally. When _toggle_ is
154 specified, the current container is split opposite to the parent
155 container's layout.
156
157*splith*
158 Equivalent to *split horizontal*
159
160*splitv*
161 Equivalent to *split vertical*
162
163*splitt*
164 Equivalent to *split toggle*
165
166*sticky* enable|disable|toggle
167 "Sticks" a floating window to the current output so that it shows up on all
168 workspaces.
169
170The following commands may be used either in the configuration file or at
171runtime.
172
173*assign* <criteria> [→] <workspace>
174 Assigns views matching _criteria_ (see *CRITERIA* for details) to
175 _workspace_. The → (U+2192) is optional and cosmetic. This command is
176 equivalent to:
177
178 for\_window <criteria> move container to workspace <workspace>
179
180*bindsym* <key combo> <command>
181 Binds _key combo_ to execute the sway command _command_ when pressed. You
182 may use XKB key names here (*xev*(1) is a good tool for discovering these).
183
184 Example:
185
186 # Execute firefox when alt, shift, and f are pressed together
187 bindsym Mod1+Shift+f exec firefox
188
189 *bindcode* <code> <command> is also available for binding with key codes
190 instead of key names.
191
192*client.<class>* <border> <background> <text> <indicator> <child\_border>
193 Configures the color of window borders and title bars. All 5 colors are
194 required, with the exception of *client.background*, which requires exactly
195 one. Colors may be specified in hex, either as _#RRGGBB_ or _#RRGGBBAA_.
196
197 The available classes are:
198
199 *client.background*
200 Ignored (present for i3 compatability).
201
202 *client.focused*
203 The window that has focus.
204
205 *client.focused\_inactive*
206 The most recently focused view within a container which is not focused.
207
208 *client.placeholder*
209 Ignored (present for i3 compatability).
210
211 *client.unfocused*
212 A view that does not have focus.
213
214 *client.urgent*
215 A view with an urgency hint. *Note*: This is not currently implemented.
216
217 The meaning of each color is:
218
219 _border_
220 The border around the title bar.
221
222 _background_
223 The background of the title bar.
224
225 _text_
226 The text color of the title bar.
227
228 _indicator_
229 The color used to indicate where a new view will open. In a tiled
230 container, this would paint the right border of the current view if a
231 new view would be opened to the right.
232
233 _child\_border_
234 The border around the view itself.
235
236The default colors are:
237
238[- *class*
239:[ _border_
240:[ _background_
241:[ _text_
242:[ _indicator_
243:[ _child\_border_
244|[ *background*
245: n/a
246: #ffffff
247: n/a
248: n/a
249: n/a
250| *focused*
251: #4c7899
252: #285577
253: #ffffff
254: #2e9ef4
255: #285577
256| *focused\_inactive*
257: #333333
258: #5f676a
259: #ffffff
260: #484e50
261: #5f676a
262| *unfocused*
263: #333333
264: #222222
265: #888888
266: #292d2e
267: #222222
268| *urgent*
269: #2f343a
270: #900000
271: #ffffff
272: #900000
273: #900000
274| *placeholder*
275: #000000
276: #0c0c0c
277: #ffffff
278: #000000
279: #0c0c0c
280
281*debuglog* on|off|toggle
282 Enables, disables or toggles debug logging. _toggle_ cannot be used in the
283 configuration file.
284
285*default\_border* normal|none|pixel [<n>]
286 Set default border style for new tiled windows.
287
288*default\_floating\_border* normal|none|pixel [<n>]
289 Set default border style for new floating windows. This only applies to
290 windows that are spawned in floating mode, not windows that become floating
291 afterwards.
292
293*exec* <shell command>
294 Executes _shell command_ with sh.
295
296*exec\_always* <shell command>
297 Like exec, but the shell command will be executed _again_ after *reload*.
298
299*floating\_maximum\_size* <width> x <height>
300 Specifies the maximum size of floating windows. -1 x -1 removes the upper
301 limit.
302
303*floating\_minimum\_size* <width> x <height>
304 Specifies the minimum size of floating windows. The default is 75 x 50.
305
306*floating\_modifier* <modifier> [normal|inverse]
307 When the _modifier_ key is held down, you may hold left click to move
308 windows, and right click to resize them. If _inverse_ is specified, left
309 click is used for resizing and right click for moving.
310
311*floating\_scroll* up|right|down|left [command]
312 Sets a command to be executed when the mouse wheel is scrolled in the
313 specified direction while holding the floating modifier. Resets the
314 command, when given no arguments.
315
316*focus\_follows\_mouse* yes|no
317 If set to _yes_, moving your mouse over a window will focus that window.
318
319*font* <font>
320 Sets font for use in title bars in Pango format.
321
322*for\_window* <criteria> <command>
323 Whenever a window that matches _criteria_ appears, run list of commands.
324 See *CRITERIA* for more details.
325
326*gaps* edge\_gaps on|off|toggle
327 When _on_, gaps will be added between windows and workspace edges if the
328 inner gap is nonzero. When _off_, gaps will only be added between views.
329 _toggle_ cannot be used in the configuration file.
330
331*gaps* <amount>
332 Sets _amount_ pixels of gap between windows and around each workspace.
333
334*gaps* inner|outer <amount>
335 Sets default _amount_ pixels of _inner_ or _outer_ gap, where the former
336 affects spacing between views and the latter affects the space around each
337 workspace.
338
339*gaps* inner|outer all|workspace|current set|plus|minus <amount>
340 Changes the gaps for the _inner_ or _outer_ gap. _all_ changes the gaps for
341 all views or workspace, _workspace_ changes gaps for all views in current
342 workspace (or current workspace), and _current_ changes gaps for the current
343 view or workspace.
344
345*hide\_edge\_borders* none|vertical|horizontal|both|smart
346 Hides window borders adjacent to the screen edges. Default is _none_.
347
348*input* <input\_device> *{* <commands...> *}*
349 _commands..._ after *{* will be interpreted as input commands applying to
350 the specified input device. For details, see *sway-input*(5). A newline is
351 required between *{* and the first command, and *}* must be alone on a
352 line.
353
354 \* may be used in lieu of a specific device name to configure all input
355 devices. A list of input device names may be obtained via *swaymsg -t
356 get\_inputs*.
357
358*seat* <seat> *{* <commands...> *}*
359 _commands..._ after *{* will be interpreted as seat commands applying to
360 the specified seat. For details, see *sway-input*(5). A newline is required
361 between *{* and the first command, and *}* must be alone on a line.
362
363*seat* <seat> cursor move|set <x> <y>
364 Move specified seat's cursor relative to current position or wrap to
365 absolute coordinates (with respect to the global coordinate space).
366 Specifying either value as 0 will not update that coordinate.
367
368*seat* <seat> cursor press|release left|right|1|2|3...
369 Simulate pressing (or releasing) the specified mouse button on the
370 specified seat.
371
372*kill*
373 Kills (closes) the currently focused container and all of its children.
374
375*smart\_gaps* on|off
376 If smart\_gaps are _on_ gaps will only be enabled if a workspace has more
377 than one child.
378
379*mark* --add|--replace [--toggle] <identifier>
380 Marks are arbitrary labels that can be used to identify certain windows and
381 then jump to them at a later time. By default, *mark* sets _identifier_ as
382 the only mark on a window. _--add_ will instead add _identifier_ to the
383 list of current marks. If _--toggle_ is specified mark will remove
384 _identifier_ if it is already marked.
385
386*mode* <mode>
387 Switches to the specified mode. The default mode _default_.
388
389*mode* <mode> *{* <commands...> *}*
390 _commands..._ after *{* will be added to the specified mode. A newline is
391 required between *{* and the first command, and *}* must be alone on a
392 line. Only *bindsym* and *bindcode* commands are permitted in mode blocks.
393
394*mouse\_warping* output|none
395 If _output_ is specified, the mouse will be moved to new outputs as you
396 move focus between them.
397
398*no\_focus* <criteria>
399 Prevents windows matching <criteria> from being focused automatically when
400 they're created. This has no effect on the first window in a workspace.
401
402*output* <name> mode|resolution|res <WIDTHxHEIGHT>[@<RATE>[Hz]]
403 Configures the specified output to use the given mode. Modes are a
404 combination of width and height (in pixels) and a refresh rate that your
405 display can be configured to use. For a list of available modes for each
406 output, use *swaymsg -t get\_outputs*.
407
408 Examples:
409
410 output HDMI-A-1 mode 1920x1080
411
412 output HDMI-A-1 mode 1920x1080@60Hz
413
414*output* <name> position|pos <X,Y>
415 Places the specified output at the specific position in the global
416 coordinate space.
417
418*output* <name> scale <factor>
419 Scales the specified output by the specified scale _factor_. An integer is
420 recommended, but fractional values are also supported. If a fractional
421 value are specified, be warned that it is not possible to faithfully
422 represent the contents of your windows - they will be rendered at the next
423 highest integral scale factor and downscaled. You may be better served by
424 setting an integral scale factor and adjusting the font size of your
425 applications to taste.
426
427*output* <name> background|bg <file> <mode>
428 Sets the wallpaper for the given output to the specified file, using the
429 given scaling mode (one of "stretch", "fill", "fit", "center", "tile").
430
431**output** <name> background|bg <color> solid\_color
432 Sets the background of the given output to the specified color. _color_
433 should be specified as _#RRGGBB_. Alpha is not supported.
434
435**output** <name> transform <transform>
436 Sets the background transform to the given value. Can be one of "90", "180",
437 "270" for rotation; or "flipped", "flipped-90", "flipped-180", "flipped-270"
438 to apply a rotation and flip, or "normal" to apply no transform.
439
440*output* <name> disable|enable
441 Enables or disables the specified output (all outputs are enabled by
442 default).
443
444*NOTES FOR THE OUTPUT COMMANDS*
445
446You may combine output commands into one, like so:
447
448 output HDMI-A-1 mode 1920x1080 pos 1920,0 bg ~/wallpaper.png stretch
449
450You can get a list of output names with *swaymsg -t get\_outputs*. You may also
451match any output by using the output name "\*". Be sure to add this output
452config after the others, or it will be matched instead of the others.
453
454*show\_marks* on|off
455 If *show\_marks* is on, marks will be displayed in the window borders.
456 Any mark that starts with an underscore will not be drawn even if the
457 option is on. The default is _on_.
458
459*opacity* <value>
460 Set the opacity of the window between 0 (completely transparent) and 1
461 (completely opaque).
462
463*unmark* [<identifier>]
464 *unmark* will remove _identifier_ from the list of current marks on a
465 window. If _identifier_ is omitted, all marks are removed.
466
467*workspace* [number] <name>
468 Switches to the specified workspace. The string "number" is optional and is
469 used to sort workspaces.
470
471*workspace* prev|next
472 Switches to the next workspace on the current output or on the next output
473 if currently on the last workspace.
474
475*workspace* prev\_on\_output|next\_on\_output
476 Switches to the next workspace on the current output.
477
478*workspace* <name> output <output>
479 Specifies that workspace _name_ should be shown on the specified _output_.
480
481*workspace\_auto\_back\_and\_forth* yes|no
482 When _yes_, repeating a workspace switch command will switch back to the
483 prior workspace. For example, if you are currently on workspace 1,
484 switch to workspace 2, then invoke the "workspace 2" command again, you
485 will be returned to workspace 1. Default is _no_.
486
487*workspace\_layout* default|stacking|tabbed
488 Specifies the initial layout for new workspaces.
489
490# CRITERIA
491
492A criteria is a string in the form of, for example:
493
494```
495[class="[Rr]egex.*" title="some title"]
496```
497
498The string contains one or more (space separated) attribute/value pairs. They
499are used by some commands to choose which views to execute actions on. All
500attributes must match for the criteria to match.
501
502Criteria may be used with either the *for\_window* or *assign* commands to
503specify operations to perform on new views. A criteria may also be used to
504perform specific commands (ones that normally act upon one window) on all views
505that match that criteria. For example:
506
507Focus on a window with the mark "IRC":
508
509```
510[con_mark="IRC"] focus
511```
512
513Kill all windows with the title "Emacs":
514
515```
516[class="Emacs"] kill
517```
518
519Mark all Firefox windows with "Browser":
520
521```
522[class="Firefox"] mark Browser
523```
524
525The following attributes may be matched with:
526
527*app\_id*
528 Compare value against the app id. Can be a regular expression. If value is
529 \_\_focused\_\_, then the app id must be the same as that of the currently
530 focused window.
531
532*class*
533 Compare value against the window class. Can be a regular expression. If
534 value is \_\_focused\_\_, then the window class must be the same as that of
535 the currently focused window.
536
537*con\_id*
538 Compare against the internal container ID, which you can find via IPC.
539
540*con\_mark*
541 Compare against the window marks. Can be a regular expression.
542
543*floating*
544 Matches floating windows.
545
546*id*
547 Compare value against the X11 window ID. Must be numeric.
548
549*instance*
550 Compare value against the window instance. Can be a regular expression. If
551 value is \_\_focused\_\_, then the window instance must be the same as that
552 of the currently focused window.
553
554*tiling*
555 Matches tiling windows.
556
557*title*
558 Compare against the window title. Can be a regular expression. If value is
559 \_\_focused\_\_, then the window title must be the same as that of the
560 currently focused window.
561
562*urgent*
563 Compares the urgent state of the window. Can be "latest" or "oldest".
564
565*window\_role*
566 Compare against the window role (WM\_WINDOW\_ROLE). Can be a regular
567 expression. If value is \_\_focused\_\_, then the window role must be the
568 same as that of the currently focused window.
569
570*window\_type*
571 Compare against the window type (\_NET\_WM\_WINDOW\_TYPE). Possible values
572 are normal, dialog, utility, toolbar, splash, menu, dropdown\_menu,
573 popup\_menu, tooltip and notification.
574
575*workspace*
576 Compare against the workspace name for this view. Can be a regular
577 expression. If the value is \_\_focused\_\_, then all the views on the
578 currently focused workspace matches.