From Gentoo Wiki
Jump to: navigation, search
This article is a stub. You can help by expanding it.

Sway (contracted from SirCmpwn's Wayland compositor) is an open-source Wayland compositor that is designed to be compatible with the i3 window manager.


USE flags

USE flags for dev-libs/sway i3-compatible Wayland window manager

X Enable support for X11 applications (XWayland) local
elogind Enable support for rootless session via elogind local
filecaps Use Linux capability SYS_CAP_ADMIN rather than set*id for sway binary local
fish-completion Enable fish completion support local
swaybar Install 'swaybar': sway's status bar component local
swaybg Install 'swaybg': allows to set a desktop background image local
swaylock Install 'swaylock': sway's screen locker local
tray Enable support for StatusNotifierItem tray specification local
wallpapers Install sway's default wallpaper image local
zsh-completion Enable zsh completion support global


root #emerge --ask dev-libs/sway


To view all available configuration options:

user $man 5 sway


Each user running sway can edit the default configuration file in order to run a customized sway session. Gentoo stores this file at its default /etc/sway/config location:

user $mkdir -p ~/.config/sway/
user $cp /etc/sway/config ~/.config/sway/

Terminal emulator

By default the sway configuration file uses the urxvt terminal emulator (found in the x11-terms/rxvt-unicode package). It is a good idea to emerge this terminal emulator so that a terminal will be available once sway is running:

root #emerge --ask x11-terms/rxvt-unicode


To adjust sway's rendering for HiDPI displays (4K and above), the name of the display to be adjusted must be obtained. After a sway session is running, issue the following:

user $swaymsg -t get_outputs
The swaymsg USE flag must be enabled for the swaymsg command to be available on the system.

The output statement in the sway configuration file will accept a scale parameter to adjust the scaling of the high resolution display.

Executing sway

Invoke sway from TTY to execute sway WM.

If you use sys-auth/consolekit instead of systemd or elogind, run Sway using:

user $exec ck-launch-session sway

If you encounter any issues check Troubleshooting before contacting #sway on IRC.


All most key combos will be defined in the ~/.config/sway/config configuration file.

The 'logo' key is defined as the $mod value by default. On most keyboards this will be the Windows key.


Sway has a Vi-like interface. h (left), j (down), k (up), and l (right) can be used for movement.

See man 5 sway-input for more information.


The default key-combo to open a terminal emulator is $mod+Enter.

See also