Sway (window manager)

{{short description|Tiling Wayland compositor}}

{{Infobox software

| name = Sway

| logo = Sway Tree.svg

| logo_size = 150

| screenshot = Sway 1.4 Window Manager.png

| released = {{Start date and age|2016|03|24}}{{citation

| title = Sway Initial Release

| date = 2019-08-09

| url = https://github.com/swaywm/sway

| publisher = Sway

| access-date = 2019-08-09}}

| size = 5.33 MiB

| genre = Window manager

| license = MIT License

| website = {{URL|https://swaywm.org}}

| latest_release_version = 1.10.1

| latest_release_date = {{Start date and age|2025|1|26}}{{citation

| title = Sway Latest Release

| date = 2025-01-26

| url = https://github.com/swaywm/sway/releases/

| publisher = Sway

| access-date = 2025-02-02}}

| programming_language = C

| operating_system = Unix-like

| author = Drew DeVault (SirCmpwn)

}}

Sway is a tiling window manager and Wayland compositor, inspired by i3, and written in C.{{cite web|url=https://drewdevault.com/2015/12/20/State-of-sway.html|title=State of Sway - December 2015|date=2015-12-20|website=Drew DeVault’s Blog|access-date=2019-08-09|archive-date=2019-04-24|archive-url=https://web.archive.org/web/20190424224532/https://drewdevault.com/2015/12/20/State-of-sway.html|url-status=dead}} Sway is designed as a drop-in replacement for i3 using the more modern Wayland display server protocol and wlroots compositor library.{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=Wayland-wlroots|title=Wlroots Is A New, Modular Wayland Compositor Library - Phoronix|website=www.phoronix.com|access-date=2019-08-09}} Sway works with existing i3 configuration files and supports most of i3's features while providing several new features of its own.{{cite web|url=https://www.phoronix.com/scan.php?page=news_item&px=Wayland-i3-Sway-Tiling%20An%20i3-Compatible|title=Linux Hardware Reviews, Open-Source Benchmarks & Linux Performance - Phoronix|website=www.phoronix.com|access-date=2019-08-09}}

Sway's default controls for manipulating windows are similar to vi. Window focus is controlled by a combination of the Super key and one of the arrow keys or h, j, k, and l.{{Cite web |title=sway/config.in at master · swaywm/sway |url=https://github.com/swaywm/sway/blob/master/config.in |access-date=2025-01-04 |website=GitHub |language=en}} Window movement is performed by the same combination of keys with the addition of the shift key.

Like i3, Sway can be extended and manipulated using its Unix domain socket and JSON-based IPC interface from many programming languages.{{citation|title=Sway - FLOSS Weekly 501| date=10 October 2018 |url=https://www.youtube.com/watch?v=4l6neZmG97w|language=en|access-date=2019-08-09}}

Sway's first stable release was on March 11, 2019, after 3.6 years of development.{{cite web|url=https://drewdevault.com/2019/03/11/Sway-1.0-released.html|title=Announcing the release of sway 1.0|date=2019-03-11|website=Drew DeVault’s Blog|access-date=2019-08-09}}

Features

Sway replicates several of i3's features:

  • Configuration is performed via a plain text file.
  • Window tiling is handled manually, rather than dynamically.
  • Windows can be split horizontally or vertically.
  • Windows can be arranged in a tabbed (horizontal listing like that found in web browsers) or stacked (vertical listing) layout.
  • Windows can be floated similar to a floating window manager.
  • Tiled and floated windows can be resized or moved using both the mouse and keyboard.{{cite web|url=https://www.fossmint.com/sway-a-tiling-wayland-i3-compatible-compositor/|title=Sway - A Tiling Wayland i3-Compatible Compositor|date=2019-03-20|website=FOSSMint: Everything About Linux and FOSS|language=en-US|access-date=2019-08-09}}
  • Sway can be completely driven from the keyboard.{{cite web|url=https://itsfoss.com/sway-window-manager/|title=Sway: A Tiling Window Manager Specially Crafted for Wayland|website=itsfoss.com|date=27 March 2019 |language=en-US|access-date=2019-08-09}}

Sway also provides several unique features:

  • Supports multiple non-modifier keys when assigning key bindings.{{citation|title=Differences from i3|date=2019-08-09|url=https://github.com/swaywm/sway|publisher=Sway|access-date=2019-08-09}}
  • Windows on the same workspace can be split into multiple containers, such that one set of windows might be arranged in a tabbed layout while the other windows on the workspace might be tiled normally, floating, or arranged in a stacked layout.
  • Handles input, output, and wallpaper configurations instead of relying on separate programs.
  • Has its own ecosystem of utilities such as swaybg, swaybar, and swayidle.
  • Gestures.

References

{{Reflist|30em}}