← Home

How I Set up My Linux Desktop

17 July, 2023

This post is intended to be a repository of tweaks for Arch Linux. You must know how to set up an Arch Linux install beforehand.

Go through the Arch installation guide. I go with Ext4 for my partitions. Refer to the bytes-per-inode ratio and reserved block sections before creating your Ext4 partition. As for the kernel, just use linux-zen. Don't bother with all those fancy-sounding custom kernels you find out there. Once you finish the base install, boot into your new system.

I'm currently using XFCE, but GNOME is another great option if you want a fancy desktop. Install whatever you prefer. Although if you prefer KDE, stay away from me, please. Go through the general recommendations. Except for security, because protection is no fun.

I use XFCE with its compositor disabled. Intel's modesetting driver now supports TearFree, thanks to our lord kerneltoast. It will eliminate tearing when you're not using a compositor. As of writing this post, the xorg-server package doesn't include it yet. I'm using xorg-server-git. Enable TearFree for the modesetting driver.

If you go with GNOME, installing gnome-shell-performance and mutter-performance from the AUR will greatly improve your experience.

Set up your GPU drivers. I use EnvyControl to manage NVIDIA Optimus. I keep my dGPU disabled unless I need it for gaming. Go through Intel graphics for Intel. Take a look at GuC/HuC firmware loading, framebuffer compression, and fastboot in particular.

Install appropriate drivers and verify hardware video acceleration. Set appropriate values for LIBVA_DRIVER_NAME and VDPAU_DRIVER. I export these and other environment variables using a bash script placed in /etc/profile.d/startup.sh. Using bashrc for this won't work, because the environment variables must be exported in the login shell.

For Firefox, refer to the hardware acceleration section. Check out touchscreen gestures and pixel-perfect trackpad scrolling. Export them using startup.sh.

For Chromium and Chromium-based browsers, refer to its hardware acceleration and force GPU acceleration sections. You can verify it at chrome://gpu. Video decoding information is at the bottom of the page. You can enable touchpad gestures on Chromium too. To enable middle mouse button scrolling, add the following flags:

# Disable unsupported flag warning
--test-type

# Enable middle mouse scroll
--enable-blink-features=MiddleClickAutoscroll

Profile-sync-daemon can help speed up your browser performance by storing your browser profiles in tmpfs. You can also store your browser cache in tmpfs, Arch has instructions for both Firefox and Chromium, although I only use PSD.

Now onto power management. I use a script written by our lord kerneltoast. Create /etc/systemd/system/powersave.service with the following contents:

[Unit]
Description=Powersave auto tune
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "find /sys -regex '.*?power/control$' ! -path '*usb*' -exec bash -c 'echo on > {}; echo auto > {}' \\\;"

[Install]
WantedBy=suspend.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target
WantedBy=multi-user.target

This enables runtime power management for all devices except USB. You can modify it to include certain USB devices if you really wish to.

For CPU frequency scaling, I use thermald and auto-cpufreq. Disable pstate drivers if you're using auto-cpufreq. I've used power-profiles-daemon in the past, but I find auto-cpufreq to be better (muh userspace daemon). Regardless of what you choose, do not touch TLP.

If possible, undervolt your CPU and GPU. On Intel machines, you can disable SGX in your BIOS to disable the Plundervolt fixes, which should enable undervolting on newer machines. Don't be put off by the warning on the Arch Wiki page. I have my CPU undervolted to -150mV and GPU to -100mV. Your mileage will vary. Start at -80mV for the CPU and -50mV for the GPU.

Don't use swapfiles or swap partitions, use zram instead. As we're not swapping to disk, make sure to disable zswap by adding the zswap.enabled=0 kernel parameter. My machine has plenty of RAM, so I don't use zram and also disable zswap.

Linux has had official NTFS drivers for a while now, but there are no official userspace utilities for NTFS3. Install ntfsprogs-ntfs3 from the AUR. This lets you use all the NTFS-3G utilities but with NTFS3 instead.

Other tweaks that I perform:

I will be updating this post as I go around changing/adding stuff. If you have any suggestions, feel free to mail me!