Install Alacritty

Chocolatey is software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages. Chocolatey integrates w/SCCM, Puppet, Chef, etc. Chocolatey is trusted by businesses to manage software deployments. Alacritty is a free and open-source GPU accelerated terminal emulator focused on performance and simplicity. Consequently, it does not support tabs or splits and is configured by editing a text file. It is written in Rust and uses OpenGL (for performance). Similar terminal emulator that uses OpenGL is Kitty.

  1. Install Alacritty Ubuntu
  2. Install Alacritty Arch

Install wlroots and sway from source.

Introduction

Install Alacritty Ubuntu

In this section we are going to build wlroots (required to build sway) and sway from the source repository.

We will be building the latest stable version that seems to be supported by the dependecies in ubuntu 20.04: Sway 1.5.1

Build wlroots

Here we will be building and installing wlroots.

Dependencies

Start by installing the essentials tools, we will be using pip to install an updated version of meson.

Meson

wlroots requires a more up to date version of meson from what ubuntu provides, we will be using pip to install an updated one.

We now need this to be available under PATH:

Add the line at the end of your .bashrc in your home and source it:

Next are direct dependencies of wlroots:

The next ones are optional dependencies for x11 support, not required if you want a full wayland installation.

If you don't know exactly why you don't need them, I highly encourage you to install them:

Build & Install

Now we will be cloning, building and installing wlroots.

Clone the repo

You can choose the path you prefer for the following steps, I will be working in ~/sway-build.

Build wlroots

Install wlroots

And that's it, with this you have successfully installed wlroots.

Install Alacritty Arch

Build Sway

Here we will be building and installing Sway.

Dependencies

The list of what we need now is smaller:

Build & Install

Now we will be cloning, building and installing sway.

Clone the repo

We will be using the path created in the wlroots steps:

Build sway

Install sway

That's it you just installed Sway! 🎉

Sanity Checks & Post Install

Desktop File

You should have this file /usr/local/share/wayland-sessions/sway.desktop with these contents:

This file is what allows the login manager to select the environment Sway to start at login.

A neat trick is that you can Exec a custom script that sets some environment variables or does something else before starting sway, but we will see other ways to set these variables in further parts of the guide.

Config File

You can copy the default sway config from /usr/local/etc/sway/config to ~/.config/sway/config:

This is the file you will be modifying to customize the sway behaviour and keybinds.

note: if you have an i3 config, you can copy that in the same path as above instead of the default one and it should work.

Final dependencies

Whaaat ?? More dependencies ???

Install alacritty ubuntu

Bear with me, the default config expects some programs for some of its configuration, they can be changed but to make it work let's just install them and later we will see replacements.

The missing deps are:

  • dmenu: default menu when using <mod>+d
  • swaybg: allows sway to handle background images
  • swayidle: allows sway to handle idle functionality
  • swaylock: locks the screen
  • alacritty: default terminal emulator in sway

You can install them with:

For alacritty, please see the alacritty optional section below before trying sway.

Idle behaviour

You might want to uncomment this exec from the default config to have the idle behaviour you expect of screen locking and screen turn off:

In a later section of the guide we will see how to have a custom behaviour to blur the screen on lock, a totally useless thing but definitely neat.

Start Sway

Now we can finally start sway!

Logout and in the bottom right widget on login select Sway and proceed to login:

You will be greeted by a pretty empty but clean virtual desktop:

To exit Sway you can press the keys <mod>+shift+e that will bring up a popup where you will have to click with the mouse to confirm:

Now you can experiment with Sway to see if it fits your workflow, with the default config you can use these commands to open a new terminal and close windows:

  • <mod>+enter - Open a new terminal
  • <mod>+shift+q - Close window
  • <mod>+d - Open dmenu

Great! This concludes the simple install of Sway, if you are interested in some tools and configurations that I find useful for my day to day work, check the Extra section!

I hope you will enjoy this new workflow as much as I do, and if you do not, you learned something new today!

Alacritty (Optional)

Install

The default terminal in the Sway config is Alacritty.

Install

Install alacritty on ubuntu

To get an up to date version on Ubuntu you can use the following ppa:

Change default terminal

You don't have to use it and you can change the default by changing this line in the Sway config:

for example to use gnome-terminal:

Why I use it

My personal reason for using alacritty is that I was looking for a minimal terminal to pair with Sway and it supports vi keybinds.