Table of Contents
sway
sway is currently the most stable wayland compositor I have ever used. It's a drop-in replacement to i3.
Setup
Software
Here is the list of software I use with sway to run a functionning desktop:
- sway
- swaylock
- foot
- waybar
- fuzzel
- mako
- micro
- yazi
- aerc
Quick install
Here is an opinionated barebones list of basic programs you will need to run sway. For a full overview of tools and software I use, there is a list in the dotfiles entry of the wiki.
sudo pacman -S sway swayidle swaylock swaybg \
foot waybar fuzzel mako wlsunset wl-clipboard \
Sources
- archlinux
- gentoo wiki
Troubleshooting
Common Issues with Screen Locking and Power Management
When configuring swayidle for automatic screen locking and display power management, certain syntax errors can prevent proper functionality.
Problematic Configuration
exec swayidle -w \
timeout 600 'waylock -fork-on-lock'\
timeout 900 'swaymsg "output * power off"'\
resume 'swaymsg "output * dpms on"'\
before-sleep 'waylock'
Issues:
waylock -fork-on-lockuses an invalid flag that doesn't exist- Mixing
power offwithdpms oncreates inconsistent commands
Corrected Configuration
exec swayidle -w \
timeout 600 'waylock' \
timeout 900 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
before-sleep 'waylock'Power vs DPMS Commands
Modern approach (recommended):
swaymsg "output * power off/on"- Uses current Wayland protocols
Legacy approach (still works):
swaymsg "output * dpms off/on"- Based on older X11 DPMS standards
Both achieve the same result, but power commands are preferred for new
configurations as they use modern Wayland-native protocols and are more
future-proof.
foot-server socket not starting after reboot (Sway)
Symptom: foot-server.socket is enabled but foot-server.service never starts
after reboot. graphical-session.target remains inactive.
Root cause: foot-server.service depends on graphical-session.target, which
can only be activated by a registered compositor service — not manually. Sway doesn't
register itself with systemd by default.
Fix:
-
Create a sway session target:
~/.config/systemd/user/sway-session.target[Unit] Description=Sway compositor session BindsTo=graphical-session.target Wants=graphical-session-pre.target After=graphical-session-pre.target -
Add to
~/.config/sway/config:exec systemctl --user import-environment WAYLAND_DISPLAY DISPLAY SWAYSOCK exec systemctl --user start sway-session.target -
Override foot-server's session dependency:
~/.config/systemd/user/foot-server.service.d/override.conf[Unit] PartOf=sway-session.target After=sway-session.target -
Reload and apply:
systemctl --user daemon-reload systemctl --user start sway-session.target