Swaytile is a lightweight autotiling daemon for Sway, written in C.
It dynamically adjusts split directions as you open and arrange windows, while also providing commands for switching a workspace between different layout modes.
- Dynamic autotiling for Sway
- Written in C with minimal dependencies
- Per-workspace layout control
- Toggle between dynamic autotiling and tabbed layouts
- Force a workspace into tabbed or stacked mode
- Limit split-direction changes per workspace
- Verbose logging for debugging
- Simple command-line interface
- Builds with a standard
Makefile
Beware the layout function is superficial because Sway does not provide a direct way to solve this, therefore it can come to a increasingly noticable delay when toggleing back to a very deeply nested split layout.
Clone the repository:
git clone https://github.com/pagesareblank/Swaytile.git
cd SwaytileBuild:
makeThis produces the swaytile executable.
You can then install it system-wide if desired:
sudo make installNote: The exact installation location depends on the project's
Makefile.
Usage: swaytile [OPTIONS]
Options:
-t, --toggle <MODE> Change or toggle workspace layout mode:
- toggle : Toggle between tabbed and dynamic autotiling
- tabbed : Flatten windows into a single tabbed row
- stacked : Flatten windows into a single stacked column
- split : Restore dynamic autotiling
-w, --workspace <WS> Limit autotiling to specific workspace(s)
-l, --limit <NUM> Cap the number of split direction changes per workspace
-v, --verbose Enable verbose logging output to stderr
-h, --help Display this help message and exit
Start Swaytile normally:
swaytileEnable verbose logging:
swaytile --verboseRestrict autotiling to a workspace:
swaytile --workspace 1Set a workspace to tabbed mode:
swaytile --toggle tabbedSet a workspace to stacked mode:
swaytile --toggle stackedReturn to dynamic autotiling:
swaytile --toggle splitToggle between tabbed and dynamic autotiling:
swaytile --toggleLimit the number of split-direction changes:
swaytile --limit 3Swaytile is intended to run as a background daemon alongside Sway.
For example, you can start it from your Sway configuration:
exec swaytileYou can also bind the layout controls to Sway keybindings:
bindsym $mod+t exec swaytile --toggle
bindsym $mod+Shift+t exec swaytile --toggle tabbed
bindsym $mod+Shift+s exec swaytile --toggle stacked
bindsym $mod+Shift+d exec swaytile --toggle splitAdjust the keybindings to your own configuration.
The default mode dynamically chooses split directions as windows are added, providing an automatic tiling layout without manually selecting horizontal or vertical splits.
swaytile --toggle tabbedFlattens the current workspace into a single tabbed row.
swaytile --toggle stackedFlattens the current workspace into a single stacked column.
stacking may also be used as an alias for stacked.
swaytile --toggle splitRestores dynamic autotiling.
default may also be used as an alias for split.
Autotiling can be restricted to specific workspaces using:
swaytile --workspace <WORKSPACE>This is useful when you want Swaytile to manage only selected workspaces while leaving others under manual control.
The --limit option allows you to cap how many split-direction changes Swaytile can make on a workspace:
swaytile --limit 3This can help prevent layouts from becoming overly fragmented as more windows are opened.
For debugging or troubleshooting:
swaytile --verboseVerbose output is written to stderr, making it possible to redirect or inspect logs separately from normal program output.
Swaytile uses a Makefile for compilation.
Build the project with:
makeClean build artifacts with:
make cleanIf your Makefile provides an install target:
sudo make install- Linux
- Sway
- A C compiler
make
Sway already provides powerful manual control over window layouts. Swaytile is designed for users who prefer an automatic layout while still wanting the ability to take control when necessary.
The daemon handles the repetitive work of choosing split directions, while the command-line interface makes it easy to temporarily switch a workspace to another layout.
See the LICENSE file for licensing information.
Contributions, bug reports, and suggestions are welcome.
If you find a bug or have an idea for improving Swaytile, feel free to open an issue or submit a pull request.
Swaytile — automatic tiling for Sway, written in C.