Install Sway tiling WM

Install Sway on Fedora by adding the `sway` package via `dnf`, which automatically pulls in necessary dependencies like `wlroots` and `wlr-randr`.

You switched to a tiling window manager and the screen went black

You installed Fedora Workstation, opened a terminal, and typed sudo dnf install sway. The package manager finished, you logged out, and selected Sway from the session menu. The screen went black. A cursor blinked in the top-left corner. No desktop environment, no panels, no obvious way to open a terminal. This is not a bug. This is exactly how a tiling window manager behaves when it has no instructions. Sway does not guess what you want. It waits for you to tell it how to arrange windows, where to draw backgrounds, and which key combinations trigger actions.

What Sway actually does

Sway is a drop-in replacement for i3, but it runs on Wayland instead of X11. Wayland changes the security model. The compositor owns the screen buffer. Applications cannot draw directly to the framebuffer. They send requests to the compositor, which composites them into a single image and pushes it to the GPU. Because of this strict boundary, background images, screen lockers, and idle timeouts cannot be handled by the window manager itself. They run as separate processes that communicate with Sway over D-Bus or Wayland protocols. That is why swaybg, swayidle, and swaylock exist as independent packages. Sway just orchestrates them.

Think of Sway as a stage manager. It does not paint the backdrop. It does not lock the theater doors. It tells the lighting crew when to dim the house lights and tells the actors where to stand. When you press a key, Sway routes the event to the correct application. When an application requests a new window, Sway calculates the split ratio and updates the layout tree. The compositor stays out of the way. You get a predictable, keyboard-driven workspace that does not fight you over focus or window placement.

Run journalctl -xeu sway before you guess. The log shows exactly which protocol handshake failed.

Install the compositor and its dependencies

Here is how to pull the core compositor and the standard Wayland utilities onto a default Fedora system.

sudo dnf install sway swaybg swayidle swaylock-effects grim slurp wofi alacritty
# --setopt=install_weak_deps=False keeps the transaction lean
# swaybg draws the desktop background
# swayidle handles screen lock and DPMS power states
# swaylock-effects provides a visual lock screen with blur
# grim captures the Wayland screen buffer
# slurp selects a region for screenshots
# wofi acts as the application launcher and menu
# alacritty is a GPU-accelerated terminal emulator

Fedora packages these tools separately to keep the base compositor lean. The sway package itself only pulls in wlroots and wlr-randr. wlroots is the backend library that talks to the GPU and input devices. wlr-randr handles output configuration. You do not need to compile anything from source. The Fedora repositories track the upstream releases closely.

Trust the package manager. Manual file edits drift, snapshots stay.

Write a working configuration

Sway reads configuration from ~/.config/sway/config. The file uses a simple key-value syntax. Indentation matters for blocks. Comments start with #. You do not need to copy a hundred-line template from a wiki. A functional setup requires three things: a background command, an idle and lock chain, and at least one terminal keybinding.

Here is how to create the directory and populate a minimal, working configuration.

mkdir -p ~/.config/sway
# ~/.config/ follows the XDG Base Directory specification
# Sway never reads /etc/sway/ for user preferences
# System-wide defaults only apply if the user file is missing

cat > ~/.config/sway/config <<'EOF'
# Set the modifier key for window management
set $mod Mod4
# Mod4 is the Super or Windows key on most keyboards

# Launch background and idle processes at startup
exec swaybg -i /usr/share/backgrounds/fedora-background.png
# swaybg runs once and exits after drawing the image

exec swayidle -w timeout 300 'swaylock -f -c 000000' timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
# -w waits for the lock command to finish
# 300 seconds triggers the screen locker
# 600 seconds turns off the monitor via DPMS
# resume turns the monitor back on when input is detected

# Keybindings for terminal, kill, and launcher
bindsym $mod+Return exec alacritty
# Opens a new terminal in the current workspace

bindsym $mod+Shift+q kill
# Closes the focused window immediately

bindsym $mod+d exec wofi --show drun
# Launches the application menu using desktop entries

# Default output configuration
output * bg /usr/share/backgrounds/fedora-background.png fill
# Applies the background to all connected monitors
EOF

The exec commands run once when Sway starts. The bindsym lines map keyboard shortcuts to actions. $mod defaults to the Super key. output * bg ... tells the compositor how to fill the screen. You can replace * with a specific monitor name like HDMI-A-1 if you have multiple displays with different resolutions. The wofi launcher reads .desktop files from /usr/share/applications/ and ~/.local/share/applications/. It does not require a separate menu configuration.

Reload the config with swaymsg reload instead of restarting the session. Changes apply instantly.

Start the session

You have two paths to launch the compositor. GDM handles the Wayland handshake automatically. Log out of your current session, click your user icon, and select Sway from the session menu before clicking your username. If you prefer a clean TTY boot, switch to virtual console 3 with Ctrl+Alt+F3, log in, and run sway. The command drops you into the compositor immediately. If your system boots to a graphical target by default, you can switch back to the desktop with Ctrl+Alt+F1 or F2.

Sway does not run as a systemd user service by default. It runs as a foreground process in your login shell. If you close the TTY or log out of GDM, the compositor terminates. This is intentional. It keeps your session tied to your login session. You can change this behavior by enabling sway.service in your user systemd instance, but the default behavior prevents orphaned compositor processes from lingering after logout.

Check systemctl --user status sway before you restart. The state tells you whether the session is active or waiting for input.

Verify the compositor is running

Run swaymsg -t get_version from inside a Sway terminal. The output returns the exact commit hash and release tag. If the command hangs or returns Connection refused, the compositor is not running or your terminal is not attached to the Wayland socket. Check the socket path with echo $SWAYSOCK. It should point to /run/user/1000/sway-ipc.*.sock. If the variable is empty, your shell did not inherit the environment from the compositor. Launch the terminal from the Sway keybinding instead of from a background script.

The IPC socket is how external tools talk to Sway. swaymsg sends commands over it. wofi queries it for workspace names. grim uses it to capture the screen buffer. If the socket path is wrong, every external tool fails silently.

Verify the socket path before you debug keybindings. Half the time the symptom is gone.

Common pitfalls and error patterns

SELinux denials are the most common blocker. Fedora enforces mandatory access control by default. If Sway fails to start or applications crash on launch, check the audit log. The error usually reads type=AVC msg=audit(...): avc: denied { read } for pid=... comm="sway". Do not disable SELinux. Use audit2allow to generate a targeted policy module.

Here is how to extract the denial and compile a custom policy.

sudo grep -i sway /var/log/audit/audit.log | audit2allow -M sway_custom
# -M names the policy module
# audit2allow parses the AVC denial and generates a .te file

sudo semodule -i sway_custom.pp
# -i installs the compiled policy into the running kernel
# The policy persists across reboots without rebooting the system

Another frequent issue is missing input methods. Wayland requires an IME configured at the compositor level. Add input * xkb_layout us to your config if your keyboard layout resets to US after login. Replace us with your actual layout code. You can list available layouts with localectl list-x11-keymap-layouts.

Output configuration errors also cause black screens. If you hardcode a monitor name like DP-1 but your laptop docks to HDMI-A-1, Sway applies the wrong resolution and the screen goes blank. Use wlr-randr to list connected outputs before writing static rules. Run wlr-randr from a TTY or inside Sway to see the exact connector names. Match those names in your output blocks.

Read the actual error before guessing. Run journalctl -xe and look for sway or wlroots in the output.

Choose your display server path

Use Sway when you want keyboard-driven window management without X11 legacy baggage. Use GNOME when you need a polished out-of-the-box desktop with automatic hardware detection. Use KDE Plasma when you want deep visual customization and traditional window controls. Use Hyprland when you want GPU-accelerated animations and a modern Wayland compositor built from the ground up. Stay on the default Workstation session if you only deviate from the defaults occasionally.

Where to go next