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 output command to configure outputs instead of xrandr
  • Use the output command to configure your wallpaper instead of feh
  • Use the input command to configure input devices
  • Replace usage of i3 specific programs with the equivalent sway tools:
  • Sway handles quotes slightly differently - commands are handled more like shell commands
  • To emulate xset dpms force off, use swayidle timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' then run pkill -USR1 swayidle to trigger timeout immediately.

Font configuration

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.

Common X11 apps used on i3 with Wayland alternatives

X11 Input configuration alternatives

xset s off; xset dpms 0 0 0

Aren't needed because sway doesn't put your monitor into standby by default. But swayidle can be used if you want to.

xset m 0 0

Replace with:

input "type:pointer" {
  accel_profile flat
  pointer_accel 0
}

xset r rate 300 50

Replace with:

input "type:keyboard" {
  repeat_delay 300
  repeat_rate  50
}

xset b off

Not supported by sway.

setxkbmap -option terminate:ctrl_alt_bksp,caps:super,altwin:menu_win

Replace with:

input "type:keyboard" {
  xkb_options terminate:ctrl_alt_bksp,caps:super,altwin:menu_win
}

Caps Lock as $mod

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,…
}

See Also

⚠️ **GitHub.com Fallback** ⚠️