Each line consists of a comment or a command and its arguments which are parsed sequentially but independently from the rest of the file.
Each line starting with a "#" is a comment.
See KEY DEFINITIONS for details on modifier keys and MODES for details on modes.
Return to default mode
background <r> <g> <b>
Set RGB of background - <[r|g|b]> are floating point numbers between 0 and 1. There is no support for background images.
# Set background to red background 1.0 0.0 0.0
bind <key> <command>
Bind <key> to execute <command> if pressed in root mode
bind <key> <command> # is equivalent to definekey root <key> <command>
Close current window - This may be useful for windows of applications which do not offer any method of closing them.
configure_message [font <font description>|[f|b]g_color <r> <g> b> <a>|display_time <n>]
Configure message characteristics -
•font <font description> sets - <font description> is - X core font description or - FreeType font description via pango
•fg_color <r> <g> <b> <a> sets RGBA of foreground
•bg_color <r> <g> <b> <a> sets RGBA of background
•display_time <n> sets display time in seconds
# Set font ## Set example X code font configure_message font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 ## Set example FreeType font description configure_message font pango:monospace 10 # Set foreground RGBA to red configure_message fg_color 1.0 0.0 0.0 1.0 # Set background RGBA to red configure_message bg_color 1.0 0.0 0.0 1.0 # Set duration for message display to four seconds configure_message display_time 4
definekey <mode> <key> <command>
Bind <key> to execute <command> if pressed in <mode> - definekey is a more general version of bind.
Define new mode <mode> - After a call to definemode, <mode> can be used with definekey to create a custom key mapping.
# define new mode and create a mapping for it definemode foo definekey foo C-t abort
Set <key> to switch to root mode to execute one command
escape <key> # is equivalent to definekey top <key> mode root
Exchange current window with window in the tile to the bottom
Exchange current window with window in the tile to the left
Exchange current window with window in the tile to the right
Exchange current window with window in the tile to the top
Execute <command> using sh -c
Focus next tile
Focus tile to the bottom
Focus tile to the left
Focus previous tile
Focus tile to the right
Focus tile to the top
Split current tile horizontally
input <identifier> <setting> <value>
Set <setting> to <value> for device <identifier> - <identifier> can be "*" (wildcard), of the form "type:<device_type>" or the identifier of the device as printed for example by cagebreak -s. The supported input types are
Configurations are applied sequentially. Currently, only libinput devices may be configured. The available settings and their corresponding values are as follows:
Set pointer acceleration profile for specified input device
calibration_matrix <6 space-separated floating point values>
Set calibration matrix
Change click method for the specified device
Enable or disable tap-and-drag for specified input device
Enable or disable drag lock for specified input device
Enable or disable disable-while-typing for specified input device
Enable or disable send_events for specified input device - Disabling send_events disables the input device.
Enable or disable left handed mode for specified input device
Enable or disable middle click emulation
Enable or disable natural (inverted) scrolling for specified input device
Change the pointer acceleration for specified input device
Set button used for scroll_method on_button_down - The button can be given as an event name or code, which can be obtained from libinput debug-events. If set to disable, it disables the scroll_method on_button_down.
scroll_factor <floating point value>
Change the scroll factor for the specified input device - Scroll speed will be scaled by the given value, which must be non-negative.
Change scroll method for specified input device
Enable or disable tap for specified input device
Specify which button mapping to use for tapping - lrm treats 1 finger as left click, 2 fingers as right click, and 3 fingers as middle click. lmr treats 1 finger as left click, 2 fingers as middle click, and 3 fingers as right click.
Display a line of arbitrary text.
Enter mode "<mode>" - Returns to default mode, after a command is executed.
Move currently focused window to next screen
Move currently focused window to previous screen
Move currently focused window to <n>-th screen
Move currently focused window to <n>-th workspace
Focus next window in current tile
Focus next screen
Remove all splits and make current window fill the entire screen
output <name> [[pos <xpos> <ypos> res <width>x<height> rate <rate>] | enable | disable | prio <n> ]
Configure output "<name>" -
•<xpos> and <ypos> are the position of the monitor in pixels. The top-left monitor should have the coordinates 0 0.
•<width> and <height> specify the resolution in pixels.
•<rate> sets the refresh rate of the monitor (often this is 50 or 60).
•enable and disable enable or disable <name>. Note that if <output> is the only enabled output, output <output> disable has no effect.
•prio <n> is used to set the priority of an output. If nothing else is set, outputs are added as they request to be added and have a numerical priority of -1. Using prio <n> it is possible to set priorities for outputs, where <n> >= 1. The larger <n> is, the higher the priority is, that is to say, the earlier the output will appear in the list of outputs.
Focus previous window in current tile
Focus previous screen
Resize current tile towards the bottom
Resize current tile towards the left
Resize current tile towards the right
Resize current tile towards the top
Change to <n>-th screen
Display information about the current setup - In particular, print the identifiers of the available inputs and outputs.
Set default mode to <mode>
Switch to tty <n>
Split current tile vertically
Change to <n>-th workspace
Set number of workspaces to <n> - <n> is a single integer larger than 1 and less than 30.
Default mode - Keybindings defined in this mode can be accessed directly.
•definekey can be used to set keybindings for top mode.
•setmode can be used to set a different default mode.
Command mode - Keybindings defined in this mode can be accessed after pressing the key defined by escape.
•bind can be used to set keybindings for root mode.
Resize mode - Used to resize tiles.
definemode can be used to create additional modes.
Modifiers can be specified using the following syntax:
The supported modifiers are:
A - Alt
C - Control
L - Logo
S - Shift
2 - Mod2
3 - Mod 3
5 - Mod 5
For example to specify the keybinding Control+t, the expression
Mail contact: `cagebreak @ project-repo . co`
Copyright (c) 2018-2020 Jente Hidskes
Copyright (c) 2019 The Sway authors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.