DE

Sway

Articles on this Topic

Sway is a window manager for Wayland. It provides a light-weight yet feature-rich alternative to comprehensive desktop environments like Gnome or KDE. This introduction describes the general usage of such systems before specific workflows and configurations are presented in individual articles.

In this context, windows are understood as display areas where graphical applications are presented. Sway is structured so that each window is assigned to a workspace. For example, one such space may be used to host applications related to communication. Here as elsewhere, Sway supports a keyboard-driven workflow to arrange and access workspaces.

When using multiple screens, Sway assigns workspaces to physical monitors. For instance, one could display communication programs on a smaller screen while an ultrawide monitor is used for the primary work.

By default, windows are arranged as tiles that optimally utilize the entire screen real estate. When opening another graphical application, the available space is divided into vertical or horizontal sections called splits. Only one single window is in focus at any given time, and only the application within that window receives keyboard signals.

The image shows two windows occupying the left and right halves of the screen. The left window contains Firefox with a Fedora Magazine website tab. The right window shows a terminal with the Fedora logo in ASCII and system information below.
Sway with horizontal splits in the tiling layout. Since Firefox is not in focus, the task bar is displayed with some opacity.

Sway supports additional layouts. Windows can be stacked on top of each other so that only the currently active window is visible and in focus. In the tabbed layout, the window-selection tabs is arranged side by side on a single bar, while in the stacked layout, they are arranged vertically with each selection at full width. In addition, every window in any layout can be set to full-screen mode.

The image shows a Firefox window. In Firefox, a tab with DuckDuckGo is open. At the top, there are two bars spanning the entire width of the screen. The first bar contains white text on a blue background: DuckDuckGo - Your protection, our priority. - Mozilla Firefox. The second bar contains white text on a black background: Internet for people, not profit - Mozilla (UK) - Firefox Developer Edition.
Sway with tabs as placed within the stacking layout.

When discussing Tiling Window Managers, this is typically in contrast to Floating Window Managers. While a tiling layout optimizes screen usage, floating layouts allow windows to move freely and adjust in size. This flexibility is particularly helpful for applications like file explorers or pop-ups.

The image shows a window occupying approximately 70 percent of the screen space and is centrally positioned. Behind it are two windows, each taking up exactly half of the left and right sides of the screen. In the front window, a file explorer is open. In the rear left window, Firefox is open while in the rear right window, a terminal is open.
Sway with a floating window.

The general visual appearance can be customized. For example, the spaces between tiles (called gaps) or the color highlighting of the active window are configurable. Applications are often opened via keyboard shortcuts or automatically at system startup; such settings are made directly in the main configuration.

Many users supplement their window manager with additional applications. A launcher like Rofi makes it easier to start applications without assigned keyboard shortcuts. Waybar is a bar that was specifically developed for Sway; it offers system information, a system tray, and workspace management via mouse click.

Sway defines itself as a Wayland port of i3, a window manager for X11. The design follows the same principles and the configuration files are largely compatible with each other. Most features were adopted, and Sway’s development follows that of i3.