i3 Migration Guide - swaywm/sway GitHub Wiki
Sway is almost a drop-in replacement for i3, but you may have to make a few changes to get everything working correctly. Here are a few common ones:
- Use the
outputcommand to configure outputs instead of xrandr - Use the
outputcommand to configure your wallpaper instead of feh - Use the
inputcommand to configure input devices - Replace usage of
i3specific programs with the equivalent sway tools:-
i3-msg→swaymsg -
i3lock→swaylock -
i3-nagbar→swaynag -
i3bar→swaybar -
i3status→ Alternative bar content generators
-
- Sway handles quotes slightly differently - commands are handled more like shell commands
- To emulate
xset dpms force off, useswayidle timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'then runpkill -USR1 swayidleto trigger timeout immediately.
Sway does not support X logical font description (XLFD) configuration strings. Instead it uses Pango, and one can use pango-list | grep [fontname] to confirm the correct font name. Pango, as of version 1.44, does not support older bitmap fonts (BFD), although it does support bitmap-only OTF fonts.
- xbacklight (backlight management) → brightnessctl
- dunst (notification daemon) → dunst (supports wayland) / mako / fnott / swaync
- feh (wallpaper setting) → sway output configuration, see
man 5 sway-output(oroguriswww, which supports animated wallpapers), wbg - scrot (screenshot) → grim + slurp (or grimshot, which wraps around both).
- picom / compton / xcompmgr (compositor) → built in
- unclutter (hiding cursor after some time) →
seat <name> hide_cursor <timeout> - xbanish (hiding cursor on keypress) →
seat <name> hide_cursor when-typing enable - xclip / xsel (clipboard copy/paste) → wl-clipboard, wlsnarf wl-clipboard-rs, wayclip
- clipster / etc. (clipboard manager) → cliphist, wl-clipboard-history
- xdotool → wtype, wlrctl,
swaymsg seat <seat> cursor …, dotool, ydotool - xrandr →
swaymsg output …, wlr-randr - arandr (GUI to configure outputs) → wdisplays
- autorandr → kanshi
- screenkey (screencast tool to display your keys) → wshowkeys, showmethekey
- X11 forwarding → waypipe
- xev → wev
- xmodmap → custom keymap file, interception-tools
- xprop → wlprop
- xob → wob
-
dmenu → wmenu, mew, bemenu, fuzzel, gmenu, wldash
-
bemenu: To use the same color scheme used in dmenu, use
bemenu-run -p "" --tb "#285577" --hb "#285577" --tf "#eeeeee" --hf "#eeeeee" --nf "#bbbbbb"
-
bemenu: To use the same color scheme used in dmenu, use
- rofi → wofi, rofi patch
- ffmpeg x11grab (screen recorder) → wf-recorder, txproto
- VNC → wayvnc
- Redshift → gammastep, wlsunset
- slock → waylock, wlock
- kbdd (per-window keyboard layout) → swaykbdd
- sxhkd (an X daemon that reacts to input events by executing commands), shkd (a simple hotkey daemon for the Linux console. ) → swhkd
- synergy (client) → waynergy
- (n)sxiv (image viewer) → imv
Aren't needed because sway doesn't put your monitor into standby by default. But swayidle can be used if you want to.
Replace with:
input "type:pointer" {
accel_profile flat
pointer_accel 0
}
Replace with:
input "type:keyboard" {
repeat_delay 300
repeat_rate 50
}
Not supported by sway.
Replace with:
input "type:keyboard" {
xkb_options terminate:ctrl_alt_bksp,caps:super,altwin:menu_win
}
Some i3 users use xcape -e 'Super_L=Escape' so that when Caps Lock is pressed by itself, it acts as Escape. They then remap Caps Lock to Super with setxkbmap -option caps:super and use set $mod Mod4 in i3's config file to set Super as the main modifier.
The idea is that when Caps Lock is pressed by itself, it acts as Escape, which is handy in programs like Vim for returning from Insert mode to Normal mode. When Caps Lock is pressed with another key, it acts like the Super key, so you can switch between desktops by pressing Caps+1, Caps+2, Caps+3, and so on. It's more convenient than pressing Super + number keys because you can do it with one hand.
To replicate this setup, add the following to ~/.config/sway/config:
set $mod Escape # main modifier variable used in bindsym commands
floating_modifier Mod4 # to avoid config parse error
…
input "type:keyboard" {
…
xkb_options caps:escape,…
}
- FAQ
- Differences from i3
- The man pages (start with
man sway)