Prelude

I have been using Linux since secondary school, with the first distro likely being Red Hat 9. I quickly moved to try others, like SUSE Linux 9, which I remember offering a much nicer GUI interface (KDE 3). Being a schoolkid, I had a lot of time on my hands to just explore the environment and it wasn't long until I stumbled upon Gentoo in 2004. I'm not so sure now that hours of compiling kernels to suit your exact hardware configuration (on a 500Mhz Pentium 3 Coppermine speed beast) was a typical pursuit of fun, but I feel like I learnt a lot from this period.

In this article, I want to share some of my current tips regarding my setup.

Current desktop setup

I have a number of PCs that are both work devices and some personal devices as well. My distro of choice is currently Fedora Workstation. I find it to be a good balance between having the latest kernels (and fixes for newer hardware that come with them), release cadence (every 6 months) and stability. Having once found rebuilding Gentoo packages every day to be unproductive (true story!), I tried switching to both Arch and openSUSE Tumbleweed (both are rolling release distros). Things still broke way too frequently so I had to switch to a more stable alternative. During a couple of work projects I got a lot of experience building RPMs for RHEL 6/7, and Fedora, being the eventual upstream of RHEL releases seemed like a sensible choice.

I recently upgraded to Fedora 33 - surprisingly this cause a few small things that broke and this motivated me to write a post.

I use two desktop environments - sway and lxqt. (Screensharing is still a weak point in Wayland, so I drop down to LxQt for that)

sway + supporting programs

Sway is a tiling window manager with almost complete compatibility with i3wm, but using Wayland instead of X11. The list of utility programs is small and fairly common:

  • bemenu - text program launcher
  • i3status-rust - statusline showing things like load average, temperature, battery information
  • kanshi - display profile configuration (e.g. if you are docked, have left and right screen at correct scaling)
  • mako - notification daemon
  • rot8 - screen rotation daemon (for 360-style devices)

systemd-resolved and name resolution

In Fedora 33, the default DNS management switched to systemd-resolved. This broke programs running in Wine for some reason, and I decided to skip using it for now. My main home office network has a DNS server that I trust, and for life on the road I choose to use the VPN provider's DNS server exclusively. I feel that for me, there is no benefit in having yet another DNS layer to configure, so I decided to revert.

However, life is no longer as simple as editing /etc/resolv.conf because certain software (like wg-quick) expects to see the resolvconf executable in $PATH, so the steps I took are:

  1. Edit /etc/NetworkManager/NetworkManager.conf
    • In the [main] section, add dns=default to bypass systemd.
  2. systemctl disable systemd-resolved
  3. Install openresolv to get a resolvconf executable
    • I didn't find a package so just cloned the git repo and make install DESTDIR=/usr/local

sharing the PulseAudio daemon between users

I use a couple of different users locally, and sometimes it is very useful to hear sounds from multiple sessions at once. The default configuration starts a pulseaudio daemon per user, and the output device becomes locked to whichever user started using it first. This is sensible from a security standpoint but a single-human, multi-user scenario has different needs.

Pulseaudio is usually activated via a socket when a program needs to use audio output (I am not sure exactly by which mechanism), but we can start it directly when sway is started:

  1. Edit your ~/.config/sway/config to start pulseaudio
    • exec pulseaudio -D
  2. Edit /etc/pulse/client.conf with
    • default-server = unix:/tmp/pulseaudio-socket

This will make clients look for the unix socket and talk to the single server (assuming your sway session is started first). This is still not ideal, but I feel this is better than allowing a pulseaudio daemon systemwide.

fixing gpg-agent and yubikey permissions

My git commits are signed with a GPG key that is generated on a Yubikey. The key seemed to be detected by the agent and gpg2 but signing did not actually work. After some research, I came up with the following:

  1. Remove OpenSC with dnf remove opensc
  2. Stop and disable pcscd (this will be problematic if you have other smartcards for example):
    • systemctl disable pcscd.service
    • systemctl disable pcscd.socket

The closest description to the issue seems to be bug #1893131 so I hope it will be resolved in the future.

disabling text-to-speech daemon

Text-to-Speech is enabled by default, which is a nice touch should you need it, but it's a daemon potentially taking up resources, so I disabled it via systemd disable speech-dispatcherd.service. Check

disabling avahi/zeroconf

I saw some CPU spikes from the zeroconf daemon avahi, so I disabled it via systemctl disable avahi-daemon.socket and systemctl disable avahi-daemon.service. A network that has proper routing infrastructure in place has no need for it, so I'm happy to disable it.

enabling persistent storage of logs

See this gist for how to configure systemd-journald if the storage directory is not yet setup.

enabling hardware accelerated video decoding in firefox/wayland

Since June 2020, you can enabled it via some config changes in about:config.

make moby/docker work again

The currently shipping version of moby (19.03.13) at the time of writing does not support CGroups v2. You have to prevent systemd from creating them by appending systemd.unified_cgroup_hierarchy=0 to the kernel cmdline:

  • grubby --args="systems.unified_cgroup_hierarchy=0"

Conclusion

Linux on the desktop is a pretty smooth experience for experienced users these days (compared to a decade ago when you had a much bigger minefield to navigate), though giving a Gentoo installation to your grandmother may be premature still. Wayland makes navigating mixed-DPI environments relatively painless, and in general the UI interface feels a lot smoother than in the X11 days. There are niggles that are being worked on, such as the missing screen sharing support (in Chrome for example here)

As a software developer targeting mainly backend systems running on Linux, the lack of friction when developing on the same platform as the deployment target is clear. As a personal user, the amount of control and finetuning that can be applied to a system that (mostly) works out of the box is phenomenal. The tuning does not disappear between releases (hello Big Sur) and telemetry is not randomly reenabled between patch updates (hello Windows 10). Fedora so far has been the closest to things mostly just working while staying close to the edge of development.