The Sway Window Manager on Linux

Install And Configure Sway Window Manager On Ubuntu

Tiling window managers are very popular on Linux based distributions by advanced users as they do not contain bloatware like Desktop Environments, and they offer a minimal experience with extensive customization (called as ricing). We have already discussed more differences between Window Managers and desktop environments like GNOME or KDE in another article, so you may want to check that out as well.

Now, some Window Managers were developed quite some time ago, and since the Desktop Linux has been developing at a fast pace and new protocols are getting developed (like Wayland), you may want to use a Window manager that utilizes the modern display manager of Wayland instead of something old like X11 (which is going to be phased out in a few years). The Sway Window manager is one such ‘modern’ WM which works flawlessly on Wayland and offers a stable experience.

In this tutorial, we will try to install this Sway Window Manager on Ubuntu Linux and also look at a few essential customization techniques so that you can mold it as per your preference.

What is Sway Window Manager?

The Sway Window Manager is just like the i3 Window Manager and even supports its configuration files, so you can just switch from i3 to Sway while retaining the exact same config files. It also offers a few extra features which are not present on i3 as well. Sway supports everything because it is designed to be a drop-in replacement for i3 in case you just want a switch from X11 to the modern Wayland. You should keep in mind that Wayland might not be ideal for people who have installed an NVIDIA GPU, and you should try out Desktop Environments which have Wayland first before switching to a Window Manager.

Sway just supports Window Gaps and Transparency effects for different windows which are displayed on the screen and if you are looking for something which gives you ‘effects’ while opening, closing or moving windows then this Window Manager might not be for you (Try out SwayFx instead!)

Installing Sway on Ubuntu

To Install Sway on Ubuntu, just open a Terminal and type the following command:

sudo apt install sway
Installing Sway On Ubuntu
Installing Sway On Ubuntu

Ubuntu will automatically pull essential dependencies when you type this command. You can also install additional packages which will help you rice and customize your experience:

sudo apt install light git kitty swayidle swaylock sdg-desktop-portal-wlr waybar rofi fonts-font-awesome dunst
Installing Additional Packages For Sway
Installing Additional Packages For Sway

Once installed, you can just log out from Ubuntu and select Sway from the login screen and access the Window Manager.

Select Sway From The Login Screen
Select Sway From The Login Screen

I recommend you don’t do this before configuring all the things and keyboard shortcuts of Sway, otherwise you will be greeted with a very minimal Desktop and you will have to force your system to shut down and log back into GNOME.

Minimal Interface Of The Sway Window Manager
Minimal Interface Of The Sway Window Manager

Basic Sway Configuration

Taking the dotfiles from user Dexys1 on Reddit, we can just run the script to copy the dotfiles from their GitHub and configure everything automatically. Just run the following in your Terminal Window:

git clone https://github.com/Wankalo/Dotfiles.git
Clone The Dotfiles From GitHub
Clone The Dotfiles From GitHub

Once you have cloned the files, navigate to the .config directory using the cd command:

cd Dotfiles/.config/

From here, we just have to move all the files to the relevant directories, and we will be done! Just type the following command:

mv * ~/.config/

This command will move all the config files from the cloned directory to your config directory. Also, note that for this script to work correctly, you will have to place your desired Wallpaper in the ~/Pictures directory named as bg.jpg, so make sure you select your wallpaper correctly and then start the Sway session.

Running Sway On Ubuntu
Running Sway On Ubuntu

You might notice that the Icons in my screenshots show the Unicode instead of Icon because I haven’t installed the Icon pack correctly (their GitHub page didn’t mention it), but for the demonstration purposes, it works. You might try out different dotfiles from r/Unixporn and see what works for you.

Wrapping Up

That was all about the Sway Window Manager. I hope you were successfully able to understand how to install and configure it on Ubuntu. Although understanding the config file may be complicated for you if you are not familiar with how code works, but you should really try to understand the keybindings as it will improve your workflow (and because Window managers are keyboard focused).