drift is a Sway WM tool that manages a horizontal scroll-style workspace layout via the Sway IPC protocol.
It follows the Unix philosophy: it does one thing and does it well. drift never reads, writes, or manages any keybindings. Instead, it exposes a set of discrete CLI actions that map directly to Sway workspace commands. You bind those actions to keys in your own Sway config.
When drift is inactive, all action commands exit immediately without doing anything. When active, they execute the corresponding Sway IPC command to navigate the layout.
BINARY IPC SOCKET
drift ------------------------> sway
No autostart required. State is persisted in /tmp/drift.lock.
drift toggle # toggle the layout on/off
drift activate # force activate
drift deactivate # force deactivate
drift status # print "active" or "inactive"
# Configuration
drift config get max-windows
drift config set max-windows 3
drift config get overflow-delay
drift config set overflow-delay 250
# Window overflow
drift overflow # manually check window count and move to next workspace if exceeded
Starts at Sway session launch. Holds state in memory. Accepts commands over /tmp/drift.sock.
driftd # start the daemon
driftd toggle
driftd activate
driftd deactivate
driftd status
# Configuration
driftd config get max-windows
driftd config set max-windows 3
driftd config get overflow-delay
driftd config set overflow-delay 250
Both drift and driftd provide the following actions:
| Action | What it does when active |
|---|---|
next |
focus next workspace on output |
prev |
focus previous workspace on output |
move-next |
move container to next workspace and follow |
move-prev |
move container to prev workspace and follow |
back |
toggle between last two workspaces |
overflow |
(stateless only) manually check limit and trigger overflow |
(When inactive, these commands do nothing and exit 0).
drift supports an automatic window overflow feature. You can define a maximum number of windows per workspace. If drift is active and a new window is opened that exceeds this limit, the window is automatically moved to the next workspace on the output.
The configuration is saved persistently in ~/.config/drift/config.toml:
max_windows = 2
overflow_delay_ms = 250-
max_windows: The maximum number of windows allowed per workspace.
-
overflow_delay_ms: The delay in milliseconds before moving the overflowing window to the next workspace. Set to
0for instant movement. -
Daemon variant (
driftd): This feature works automatically in the background. The daemon listens to Sway window events and triggers the overflow without any extra configuration. -
Stateless variant (
drift): Since it doesn't run in the background, you must manually trigger the overflow check in your Sway config using thefor_windowdirective.
To install or update to the latest release, run:
curl -fsSL https://github.com/ezequielgk/drift/releases/latest/download/install.sh | bashThis will:
- Download the latest release tarball
- Install
driftanddriftdto~/.local/bin - Install shell completions
- Add
~/.local/binto your PATH if needed
curl -fsSL https://raw.githubusercontent.com/ezequielgk/drift/main/install.sh | bashAlternatively, to build from source:
git clone https://github.com/ezequielgk/drift
cd drift
cargo install --path crates/drift # stateless variant
cargo install --path crates/driftd # daemon variantBind your chosen keys directly to the drift actions in your Sway configuration.
# ~/.config/sway/config
# Toggle drift on/off
bindsym $mod+F1 exec drift toggle
# Bind drift actions
bindsym $mod+Right exec drift next
bindsym $mod+Left exec drift prev
bindsym $mod+Shift+Right exec drift move-next
bindsym $mod+Shift+Left exec drift move-prev
bindsym $mod+Tab exec drift back
# Enable window overflow (Stateless only)
for_window [app_id=".*"] exec drift overflow
for_window [class=".*"] exec drift overflow# ~/.config/sway/config
# Start the daemon
exec driftd
# Toggle drift on/off
bindsym $mod+F1 exec driftd toggle
# Bind drift actions
bindsym $mod+Right exec driftd next
bindsym $mod+Left exec driftd prev
bindsym $mod+Shift+Right exec driftd move-next
bindsym $mod+Shift+Left exec driftd move-prev
bindsym $mod+Tab exec driftd back--socket <PATH> override $SWAYSOCK
GPL-3.0-only