Introduction
Sway implements the i3 window manager's features and configuration format on top of the Wayland display protocol. For developers moving from X11 to Wayland, Sway provides the same keyboard-driven tiling workflow with improved security, per-monitor scaling, and modern input handling.
What Sway Does
- Tiles windows automatically in horizontal/vertical splits and tabbed/stacked layouts
- Uses the same config syntax as i3 so existing dotfiles work with minimal changes
- Supports multiple monitors with per-output scaling, rotation, and arrangement
- Manages workspaces, scratchpad, floating windows, and fullscreen modes
- Communicates with tools and scripts via an IPC socket compatible with i3ipc
Architecture Overview
Sway is built on wlroots, a modular Wayland compositor library. wlroots handles DRM/KMS output, libinput devices, and the Wayland protocol; Sway adds the tiling layout logic, config parser, and i3-compatible IPC server on top. Rendering uses the GPU directly via EGL without an intermediate X server.
Self-Hosting & Configuration
- Install from distro repos; requires a Wayland-capable GPU driver
- Copy default config:
mkdir -p ~/.config/sway && cp /etc/sway/config ~/.config/sway/ - Set keybindings, output resolution, input settings, and startup apps in the config file
- Use
swaymsgto control the compositor at runtime (same as i3-msg) - Pair with swaybar/waybar for a status bar and swaylock/swayidle for screen locking
Key Features
- Near-complete i3 configuration compatibility
- Native Wayland: better security (no X11 keylogging surface), smooth HiDPI
- Per-output fractional scaling without blurry fonts
- Criterion-based window rules for automatic tiling/floating/workspace assignment
- Active ecosystem: waybar, wofi, wl-clipboard, grim+slurp for screenshots
Comparison with Similar Tools
- i3 — the X11 original; Sway is the Wayland port with the same config
- Hyprland — Wayland compositor with animations and eye candy; less stable for daily driving
- river — minimal Wayland tiling WM configured via an external process
- dwl — dwm-like Wayland compositor; requires source patching to customize
- GNOME/KDE Wayland — full desktop environments; heavier, with floating-first UX
FAQ
Q: Can I reuse my i3 config file directly? A: Mostly yes. X11-specific directives (e.g., xrandr commands) need replacement with Sway equivalents.
Q: Do X11 apps work under Sway? A: Yes, via XWayland which is enabled by default.
Q: How do I take screenshots?
A: Use grim for full screen or grim -g "$(slurp)" for region selection.
Q: Does Sway support NVIDIA GPUs? A: Experimental support exists with the proprietary driver (--unsupported-gpu flag). The open-source nouveau driver works out of the box.