Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swaytile

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.

Features

  • 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.

Installation

Clone the repository:

git clone https://github.com/pagesareblank/Swaytile.git
cd Swaytile

Build:

make

This produces the swaytile executable.

You can then install it system-wide if desired:

sudo make install

Note: The exact installation location depends on the project's Makefile.

Usage

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

Examples

Start Swaytile normally:

swaytile

Enable verbose logging:

swaytile --verbose

Restrict autotiling to a workspace:

swaytile --workspace 1

Set a workspace to tabbed mode:

swaytile --toggle tabbed

Set a workspace to stacked mode:

swaytile --toggle stacked

Return to dynamic autotiling:

swaytile --toggle split

Toggle between tabbed and dynamic autotiling:

swaytile --toggle

Limit the number of split-direction changes:

swaytile --limit 3

Sway Configuration

Swaytile is intended to run as a background daemon alongside Sway.

For example, you can start it from your Sway configuration:

exec swaytile

You 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 split

Adjust the keybindings to your own configuration.

Layout Modes

Dynamic

The default mode dynamically chooses split directions as windows are added, providing an automatic tiling layout without manually selecting horizontal or vertical splits.

Tabbed

swaytile --toggle tabbed

Flattens the current workspace into a single tabbed row.

Stacked

swaytile --toggle stacked

Flattens the current workspace into a single stacked column.

stacking may also be used as an alias for stacked.

Split

swaytile --toggle split

Restores dynamic autotiling.

default may also be used as an alias for split.

Workspace Selection

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.

Split Limit

The --limit option allows you to cap how many split-direction changes Swaytile can make on a workspace:

swaytile --limit 3

This can help prevent layouts from becoming overly fragmented as more windows are opened.

Verbose Logging

For debugging or troubleshooting:

swaytile --verbose

Verbose output is written to stderr, making it possible to redirect or inspect logs separately from normal program output.

Building

Swaytile uses a Makefile for compilation.

Build the project with:

make

Clean build artifacts with:

make clean

If your Makefile provides an install target:

sudo make install

Requirements

  • Linux
  • Sway
  • A C compiler
  • make

Why Swaytile?

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.

License

See the LICENSE file for licensing information.

Contributing

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.

About

A autotiling daemon for the Sway window manager.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages