Switching to Wayland
This year I bought a new laptop, a Dell XPS 15. I also took this opportunity to try out something new, and fix some screen tearing issues I was annoyed about. Therefore I switched from the i3 window manager to the Sway window manager.
Sway is a drop in replacement for I3, which means my existing i3 configuration still works. It also uses Wayland, a protocol designed to replace X Window System (X11). Wayland aims to be more performant and reduce screen tearing and I can testify for both.
I’m quite happy now, but it took quite some time and sweat to get everything set up. Thus, I’ll leave this blog post for you. I already published how I remapping Capslock to Escape and how to persist audio configuration for bluetooth devices.
Replacing X11 Applications
Turns out a lot of applications were built for X11, and don’t work under Wayland. These had to be replaced.
Autotyping Passwords with Keyboards
Sadly automatically entering a password (the most important features of a Password Manager) did not work in KeepassXC. Starting it under Wayland disables the Global AutoType feature by default. And furthermore, KeepassXC can’t read the window title of a browser that runs under Wayland. Furthermore there is a long ongoing discussion about why it will probably never be supported. This makes KeepassXC unusable for me. But… thankfully, there is a workaround.
Many desktop environments already use Wayland by default, however since X11 was a bit bloated, it’s hard to completely replace it. That’s my you often see Wayland and X11 running in parallel. So does Sway, it uses Xwayland.
To be able to read the browsers window title in keepass, we need to start Firefox under Xwayland.
We can do this by setting the MOZ_ENABLE_WAYLAND
environment variable.
And of course, do the same for KeepassXC
I3 Specific Applications
Sway thankfully ships with some sane alternatives to common applications used with i3.
The i3 lock screen i3lock
was replaced by swaylock
and swayidle
.
nitrogen
for setting a desktop background can now be done with a single config line output * bg ~/wallpaper.png fill
.
Automatically dimming your screen brightness with redshift
is supported out of the box.
Hiding the Mouse Cursor when Typing
Under X I used xbanish
to hide my mouse cursor when typing.
Sway even has this configured by default with this configuration
Taking Screenshots
Previously I used scrot
inside scripts to be able to take screenshots and scan QR codes, run OCR on some display area or translate text.
There is a nice alternative though called grim
.
Sway already shipps it, and slurp
that allows you to select a rectangle on your screen.
Additionally there’s swappy
which allows you to edit an image and annotate it.
Quite useful as an alias too.
Some other useful resources I found helpful when switching
- Chris@Machine posted a video which was previously open to the public but is closed now Youtube: Arch Linux - Setting up a Minimal Install (Suckless tools)
- A Guide to Switching From i3 to Sway - by Scott Gilbertson