Desktop Linux Configuration
Here is a vague collection of things which might be useful to do for a single-user desktop running a Linux-based operating system.
elogind
elogind is a standalone distribution of systemd's logind service. If you use elogind, the sub-sections have some useful information.
Set KillUserProcesses
to yes in /etc/elogind/logind.conf
You probably want to do this for a desktop system. If you don't, elogind will leave the cgroup it creates for your session open instead of removing it when you log out. This isn't a major problem, but with the default settings each login will consume a little bit of memory which is not tidied up on logout.
Unless you're doing something weird where you need to have a persistent process running as your user which stays alive across login sessions, I recommend setting KillUserProcesses=yes
in /etc/elogind/logind.conf
.
Reduce vm.dirty_bytes
to improve IO progress reports
Put the following in /etc/sysctl.conf
(or a file in /etc/sysctl.d/
depending on your configuration) if progress reporting for IO actions (copying files to a USB, etc.) are inaccurate. This will make performance worse because it reduces how much buffering is done during writes. However, the benefit is that progress meters, etc. will be accurate.
# Make USB file transfers report the speed honestly vm.dirty_bytes=50331648 vm.dirty_background_bytes=16777216
Thunderbird Email Client
As useful as it is, there are some settings in Thunderbird which I find upsetting to hunt for every time I install the software. I have written them down here:
Navigate to Edit -> Preferences -> Advanced -> Config Editor and set the following:
- set
mailnews.send_plaintext_flowed
tofalse
- set
mailnews.default_sort_order
to2
Go to Edit -> Account Settings -> An Account -> Composition & Addressing and do the following:
- Uncheck "Compose messages in HTML format"
- Choose "Start my reply below the quote" for "When quoting"
Also: use plaintext email!
Void Linux Specific Stuff
Here are some things relevant to single-user desktops on Void...
Making X11 misc fonts available
Some X11 bitmap icon fonts like Siji get installed to /usr/share/fonts/misc/
which is not on the default font path for X11. To make sure programs can load these fonts, create a file at /etc/X11/xorg.conf.d/99-misc_fonts.conf
with the following contents:
Section "Files" FontPath "/usr/share/fonts/misc" EndSection
Disabling Bitmap Fonts in Fontconfig
The xorg-fonts package provides many fonts from adobe which can be required to be on your system by old/bad software.
Unfortunately, sometimes these fonts get loaded in modern applications and it looks crappy, because they are all bitmap fonts! To have the fonts present on your system while also not having to put up with them being selected by fontconfig, you can symlink /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf
into the /etc/fonts/conf.d
directory.
This way, modern software which uses fontconfig instead of directly looking up X11 font names won't use the bitmap fonts.
User Services
The Void handbook says you can create a runit service which runs as your user, but if you want to write services which can interact with a graphical session, you will have some problems with this.
For my purposes, I prefer to put runsvdir ~/.service
in my ~/.xinitrc
file.
When you run services this way, you have to include the path to the service directory instead of using just its name.
For example: sv restart ~/.service/service_name
instead of sv restart service_name
.
vkpurge Remnants
Sometimes, vkpurge doesn't fully remove directories for old kernels from /usr/lib/modules/
. This can confuse DKMS and make it think those versions are still installed. This isn't a catastrophic error, but you might want to check this directory periodically and remove directories for kernels that are long gone.
Pinephone
Stuff for using a pinephone together with a desktop
Use Chatty over SSH
Here is a polkit rule to let you use the modem over SSH, specifically to let you text people using chatty over SSH (with ssh -XC YOUR PINEPHONE'S HOSTNAME chatty
)
/usr/share/polkit-1/rules.d/99-org.freedesktop.ModemManager.rules
:
/* Override the requirement that the subject be an active session in order to * use ModemManager. This is done so that I can run the Chatty SMS client over * ssh with remote forwarding to use it on my desktop. */ // Let users in plugdev group modify ModemManager polkit.addRule(function(action, subject) { if ((action.id == "org.freedesktop.ModemManager1.Device.Control" || action.id == "org.freedesktop.ModemManager1.Contacts" || action.id == "org.freedesktop.ModemManager1.Messaging" || action.id == "org.freedesktop.ModemManager1.Location") && subject.isInGroup("plugdev")) { // && subject.active) { return "yes"; } });
Zathura
Zathura supports per-user configuration at ~/.config/zathura/zathurarc
. To make text selection more useful (under X11), add
set selection-clipboard clipboard
to use the clipboard most GUI applications expect.
Get Rid of the ~/Desktop/
directory
Edit ~/.config/user-dirs.dirs
to contain the following:
XDG_DESKTOP_DIR="$HOME/" XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_TEMPLATES_DIR="$HOME/Templates" XDG_PUBLICSHARE_DIR="$HOME/Public" XDG_DOCUMENTS_DIR="$HOME/Documents" XDG_MUSIC_DIR="$HOME/Music" XDG_PICTURES_DIR="$HOME/Pictures" XDG_VIDEOS_DIR="$HOME/Videos"
Then, remove the ~/Desktop/
directory. It will no longer be re-created.
Steam Trickery
Valve's Steam software ships a bunch of Linux shared libraries to help with game compatibility. You can use these libraries without running Steam by running the following:
export LD_LIBRARY_PATH=/path/to/SteamLibrary/steamapps/common/SteamLinuxRuntime/var/steam-runtime/usr/lib/x86_64-linux-gnu:/path/to/SteamLibrary/steamapps/common/SteamLinuxRuntime/var/steam-runtime/lib/x86_64-linux-gnu
The location of your SteamLibrary
depends on how you've set up Steam.
Adwaita
Broken
This was fixed, but I'm leaving this here for posterity.
folder-drag-accept
icon. Fix: symlink folder.svg
to folder-drag-accept.svg
in /usr/share/icons/Adwaita/scalable/places
.
Firefox
Firefox is currently the best of a bad bunch.
Freezing
Sometimes the whole browser chrome (but not page content) freezes when you change tabs. Tentative fix is to set nglayout.enable_drag_images
to False
in about:config
issue tracker.
Audio
You should probably use PipeWire, since that's the direction things seem to be moving in.
Loopback Sink
This config creates a loopback sink and source. If you set an application to output to the loopback sink, it will output to your default sink but you will be able to isolate it by recording the loopback source. This is useful when you want to record audio from a specific application in something such as OBS while still being able to hear it yourself.
context.modules = [ { name = libpipewire-module-loopback args = { audio.position = [ FL FR ] capture.props = { media.class = Audio/Sink node.name = loopback node.description = "Loopback Sink" } playback.props = { node.name = playback.loopback node.description = "Loopback Source" stream.dont-remix = true node.passive = true } } } ]
Buffer Size
This config sets the minimum buffer size to a value which should resolve issues with crackling/stuttering sound.
context.properties = { default.clock.min-quantum = 1024 }
Realtime Priority
Add preempt=full
and threadirqs
to your kernel cmdline.
Also, use the following PipeWire config to set a higher real-time priority:
context.modules = [ { name = libpipewire-module-rt args = { rt.prio = 90 } flags = [ ifexists nofail ] } ]
The other options available for the Pipewire's real-time module are nice.level
(which sets nice level), r.time.soft
and rt.time.hard
which set the real-time time limit in microseconds.
PipeWire will try to set its priority directly. Permission to do this is generally granted to members of the pipewire
group. The file defining these permissions for the pipewire
group is usually installed to /etc/security/limits.d/25-pw-rlimits.conf
by PipeWire (the group might have a different name, check the file to see which group is used). Alternatively, PipeWire will try to set its priority using RTKit.
In my experience, PipeWire falls back to RTKit upon the first permission error with respect to increasing its priority. For example: if PipeWire is configured to set its niceness to -11 and its realtime priority to 90, if it doesn't have permission to set its niceness to -11, it will try to use RTKit for everything, even if it does have permission to set its realtime priority to 90.
Environment Variables
PULSE_LATENCY_MSEC=milliseconds
PIPEWIRE_LATENCY=samples/sample_rate
, i.e.PIPEWIRE_LATENCY=256/48000
gives 5.33 milliseconds of latency (256 samples of latency with a sample rate of 48KHz therefore if 48K samples take 1 second, then 256 samples take 1/48K seconds = 5.33ms).
Fontconfig
Rebuild Font Cache
Run fc-cache -fv
to forcefully re-build the font cache. If fonts are not displaying correctly, this is one of the things to try.