Introduction

I’m writing this blog because I find myself nuking my OS often and it’s tedious having to do the same steps over and over again. It’s much easier having a reference. I possibly see myself turning this into an interactive script at some point, but that will just add a lot of overhead that I’m not willing to deal with now.

Prerequisites

For this guide, I assume that you’ve already installed a fresh copy of cachyos or any arch-based distro. To install cachyos, follow its official guide from the cachyos wiki.

I chose to try out sway as my desktop environment. For beginners, I recommend choosing KDE Plasma due to it’s friendly nature.

Update the system

Before performing any installs, it’s imperative to upgrade your system beforehand.

1
sudo pacman -Syu

Install essential packages

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sudo pacman -S \
paru \
git \
github-cli \
lazygit\
lazydocker \
bat \
tree \
7zip \
ffmpeg \
kdeconnect \
keychain \
android-tools

Installing Package Managers and Runtimes

Node.js

For Node, I recommend using fast node manager (fnm), which is much better than nvm:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Download and install fnm:
curl -o- https://fnm.vercel.app/install | bash

# Download and install Node.js:
fnm install --use 26

# Verify the Node.js version:
node -v # Should print "v26.13.1".

# Verify npm version:
npm -v # Should print "11.20.0".

Follow the official guide in case of errors: download node js.

Bun

1
curl -fsSL https://bun.sh/install | bash

Deno

1
curl -fsSL https://deno.land/install.sh | sh

UV

1
curl -LsSf https://astral.sh/uv/install.sh | sh

Mise

1
sudo pacman -S mise \ # Useful package manager
Install Ruby and Rails Using Mise
1
2
mise use -g ruby@latest
gem install rails

Optional Packages

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
sudo pacman -S \
tmux \
neovim \
kitty \
ttf-jetbrains-mono-nerd \
luarocks \
aria2 \
tree-sitter-cli \
imagemagick \
ghostscript \
tectonic \
mermaid-cli \
texlive-basic \
texlive-bin \
texlive-latex \
texlive-latexrecommended \
biber \
texlive-binextra \
hugo \
dart-sass \
keyd \
yazi

If you install yazi from above, it’s useful to have these as well:

1
sudo pacman -S --needed 7zip jq poppler fd ripgrep fzf  resvg imagemagick

If you plan to use zoxide afterwards, run:

1
zoxide init <shell>

where <shell> can be: bash, elvish, fish, nushell, posix, powershell, tcsh, xonsh, zsh.

Sway specific installs

Recommended packages defined in the arch wiki to use with sway:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
sudo pacman -S \
brightnessctl \
foot \
grim \
i3status \
libpulse \
mako \
playerctl \
sway-contrib \
swaybg \
swayidle \
swaylock \
waybar \
waymenu \
polkit \
xorg-xwayland \
xdg-desktop-portal-gtk \
xdg-desktop-portal-gtk \
xdg-desktop-portal-wlr \
fuzzel \
cliphist \
papirus-icon-theme \
gnome-themes-extra \
swappy \
otf-font-awesome

AUR packages:

1
2
paru -S \
cclip

Setting up git and github cli

Configuring git credentials

Configuring git credentials:

1
2
3
4
git config --global user.name "John Doe"
git config --global user.email "johndoe@github.com"

git config --global init.defaultBranch 'main'

Configuring SSH and GPG keys

To set up SSH key, follow this guide from GitHub. To set up GPG Key, follow this guide from GitHub.

Setting up GitHub CLI

GitHub CLI should be installed from the above section Install essential packages. What remains is to authorize GitHub CLI by running:

1
gh auth login

Follow the prompts and you should be good to go.

Setting up a Bluetooth Manager

You should already have bluez and bluez-utils, if you don’t install them using pacman:

1
sudo pacman -S bluez bluez-utils

I chose blueman as my bluetooth manager. Feel free to choose from the list of bluetooth managers.

1
sudo pacman -S blueman

Installing Multimedia Applications

As a prerequisite, you should have ffmpeg. This package should already be installed, especially if you installed the essential packages.

Another useful package to have is yt-dlp which allows you to download videos from a lot of applications:

1
sudo pacman -S yt-dlp

Video Player

I chose to use mpv because it’s extremely lightweight, has native wayland support, keyboard driven, supports all practical video/audio formats, and has minimal dependencies.

To install it, run:

1
sudo pacman -S mpv

Image Viewer

I chose to use imv for pretty much the same reasons as I considered when choosing my video player

1
sudo pacman -S imv

Configuring Volume and Brightness window

I’m using swayos. Get it with pacman:

1
sudo pacman -S swayosd

Configuring PWA Support

I use firefox which isn’t automatically supported on linux. I use an extension for this: Progressive Web Apps for Firefox

1
sudo pacman -S firefoxpwa

Installing a PDF Viewer

Sioyek is my PDF Reader of choice. Although the compilation process sucks, I still end up using it. Install it from AUR using:

1
paru -S sioyek-git

It’s also available as an appimage, use the command below if you like that variant:

1
paru -S sioyek-app

If you don’t like sioyek, you can use zathura which is also a fantastic alternative. It’s conveniently available through the official arch package manager. Get it as follows:

1
sudo pacman -S zathura zathura-pdf-mupdf

Installing Emacs

Since I’m using sway, emacs-wayland is much better than emacs.

1
sudo pacman -S emacs-wayland

To allow native clipboard support for Emacs, you need to install wl-clipboard.You should already have this but just in case:

1
sudo pacman -S --needed wl-clipboard

Emacs also requires symbola font and Symbols Nerd Font Mono, which you can get from AUR:

1
2
3
4
5
paru -S ttf-symbola-font
sudo pacman -S ttf-nerd-fonts-symbols

# optional: extra packages to make some of my doom emacs enabled packages to work
sudo pacman -S zig cmake tidy shfmt shellcheck inter-font ttf-ibm-plex

Afterwards, we want to enable the emacs daemon by running:

1
systemctl --user enable --now emacs

Then edit the emacs desktop entry to launch emacsclient instead of emacs. Since it’s not recommended to edit desktop entries in /usr/share/applications/ directly, we override it by copying it into our local home folder. Run:

1
2
3
4
cp /usr/share/applications/emacs.desktop ~/.local/share/applications/emacs.desktop

# Then edit it in your editor of choice
nvim ~/.local/share/applications/emacs.desktop

Change the line Exec=emacs %F to Exec=emacs -c -a 'emacs' %F

Set up doom emacs

Setting up doom emacs is easy once you’ve installed emacs. Run:

1
2
git clone --depth 1 https://github.com/doomemacs/core ~/.config/emacs
~/.config/emacs/bin/doom install

Then add doom to your $PATH. For fish, run:

1
fish_add_path ~/.config/emacs/bin

All the packages below help doom emacs run better. They are specific to my configurations since I have enabled support for multiple languages in init.el. Run doom sync or doom doctor to actually know what you need.

1
bun add -g typescript typescript-language-server stylelint js-beautify
1
sudo pacman -S discount graphiz

Setting up PostgreSQL

Start by installing postgresql as well as postgresql-libs. Installing postgresql also installs postgresql-libs as a dependency:

1
sudo pacman -S postgresql

Afterwards, you should initialize the cluster:

1
sudo -iu postgres initdb -D /var/lib/postgres/data --locale=C.UTF-8 --encoding=UTF8 --auth-local=peer

Then you should enable postgresql to autostart on boot using systemctl:

1
sudo systemctl enable --now postgresql

You can absolutely stop here but I personally like to create a passwordless superuser with the same username as my hostname. This helps me to work faster with Ruby on Rails. Follow the steps below if that what you want:

1
2
# Replace "$USER" with any username you want. This resolves to your hostname
sudo -u postgres createuser --superuser "$USER"

I also like to create a default database that matches my username:

1
2
# Again, replace "$USER" with any default database name you want
sudo -u postgres createdb "$USER"

Configuring keyd

I often like to map Capslock to be esc when pressed and Ctrl when held. For that, we’ll use keyd, which you should have if you installed optional dependencies: Optional Packages. Although it’s installed, you still need to enable it so that it auto starts on every restart:

1
sudo systemctl enable --now keyd

You configure keyd as follows:

1
2
3
4
5
# Make the configuration directory
mkdir -p /etc/keyd/

# Edit the configuration file
sudo nano /etc/keyd/default.conf

Then paste this:

1
2
3
4
5
[ids]
*

[main]
capslock = overload(control, esc)

Afterwards, reload and enable the keyd service:

1
sudo keyd reload

You have to reload keyd every time you change your keyd configurations.

Installing flatpak

1
sudo pacman -S flatpak

After install finishes, restart your system.

Setting Up Bottles

Bottles allows you to run windows application natively on Linux. Install it with:

1
flatpak install flathub com.usebottles.bottles

Install Flatseal

Flatseal is a GUI application that allows you to manage flatpak permissions. Since flatpaks run in isolated environments, you need to give them permissions to do things, like access a folder that’s outside it’s sandboxed environment, or restrict internet access.

Install it by running:

1
flatpak install flathub com.github.tchx84.Flatseal

Installing ProtonPlus

ProtonPlus is a utility application that helps to install, update, remove and organize windows compatibility tools. I use it with bottles to manage runners.

1
flatpak install flathub com.vysp3r.ProtonPlus

Setting up dotfiles

If you already have your dotfiles in git or any other version control system, now is a good time to import them.

Ensure that you have already installed all the tools you need beforehand.

I often have dotfiles for multiple tools backed up in git. Here are my dotfiles

Setting up default applications

If the desktop environment you’re using has a GUI for doing this, you can skip this step. In sway, there is no way to set default applications graphically. Instead you can to use xdg-settings to set default applications.

The general process of setting up default applications in Linux follows the same steps:

  1. Find the property you want to change, you can run xdg-settings --list or visit MIME apps spec
  2. Use xdg-settings set <property> <application>.desktop to set the default <application> for performing a specific action defined by <property>. For example xdg-settings set default-web-browser firefox.desktop to set the default web browser to firefox.
  3. Optionally associate all relevant MIME types to be opened by the application using xdg-mime.

Utility Script

.desktop entries often have a MIMEType section that defines all acceptable MIME types. You can iterate the list and map each of those MIMETypes to be opened using that specific application using xdg-mime. This is what I use in some sections where MIMETypes are too many like in setting mpv as the default video player.

To automate this, use this bash script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash

set -euo pipefail

# Usage: ./set-default-app.sh application.desktop

if [[ $# -ne 1 ]]; then
    echo "Usage: $0 <application.desktop>"
    exit 1
fi

desktop_file="$1"

# Find the desktop entry
if [[ -f "$desktop_file" ]]; then
    desktop_path="$desktop_file"
elif [[ -f "/usr/share/applications/$desktop_file" ]]; then
    desktop_path="/usr/share/applications/$desktop_file"
elif [[ -f "$HOME/.local/share/applications/$desktop_file" ]]; then
    desktop_path="$HOME/.local/share/applications/$desktop_file"
else
    echo "Error: Desktop entry not found: $desktop_file"
    exit 1
fi

desktop_name=$(basename "$desktop_path")

# Extract MIME types from the desktop entry
mime_types=$(awk -F= '
    /^\[Desktop Entry\]/ { in_entry=1; next }
    /^\[/ { in_entry=0 }
    in_entry && /^MimeType=/ {
        sub(/^MimeType=/, "")
        gsub(/;/, "\n")
        print
        exit
    }
' "$desktop_path")

if [[ -z "$mime_types" ]]; then
    echo "Error: No MIME types found in $desktop_name"
    exit 1
fi

echo "Registering $desktop_name as default:"

while IFS= read -r mime; do
    [[ -z "$mime" ]] && continue

    if xdg-mime default "$desktop_name" "$mime"; then
        echo "  ✓ $mime"
    else
        echo "  ✗ $mime"
    fi
done <<< "$mime_types"

echo "Done!"

Setting Firefox as the Default Browser

Caution: Don’t use the utility script provided above to set the default browser because it will make firefox the default application for things like pdf, audio, etc, unless that’s what you intend to do.

To get the current default browser, you can run:

1
xdg-settings get default-web-browser

First of all, find the desktop entry for the browser you want to use, for example /usr/share/applications/firefox.desktop:

1
ls /usr/share/applications | grep -i firefox

Then set it as your default browser using xdg-settings:

1
xdg-settings set default-web-browser firefox.desktop

Additionally, you can can explicitly bind http and https schemes using xdg-mime:

1
2
3
xdg-mime default firefox.desktop x-scheme-handler/http
xdg-mime default firefox.desktop x-scheme-handler/https
xdg-mime default firefox.desktop text/html

As a bonus you can install speech-dispatcher for speech synthesis, which prevents error messages such as: “You can’t use speech synthesis because the Speech Dispatcher library is missing.” on some pages like Discord.

Setting Sioyek as the Default PDF Viewer

Setting a default PDF viewer follows the same process as above:

1
xdg-mime default sioyek.desktop application/pdf

You can also use the utility script if you want to have extensive coverage.

Setting imv as the Default Image Viewer

We installed imv for image viewing in the section above. To set it as the default image viewer, we need to map all relevant MIME types to be opened with imv. We can do that manually, but a better way is to infer them from the .desktop entries which often offers an exhastive list of supported MIME types.

To do that, use the script provided in the utility script section to automate this.

1
./set-default-app imv.desktop

Setting mpv as the default Video Player

We use the same script we used to set imv as the default image viewer:

1
./set-default-app mpv.desktop

Configure Dark Theme

First of all install gnome-themes-extra and papirus-icon-theme as defined in Sway specific installs above. If you’ve not installed them, run:

1
sudo pacman -S gnome-themes-extra papirus-icon-theme

Configure GTK 3

1
2
3
mkdir ~/.config/gtk-3.0/

nvim ~/.config/gtk-3.0/settings.ini

Edit it as follows (demonstration):

1
2
3
4
5
[Settings]
gtk-application-prefer-dark-theme=1
gtk-icon-theme-name=Papirus-Dark
gtk-theme-name=Adwaita-dark
gtk-font-name=JetBrainsMono Nerd Font 11

Configure GTK 4

Use the dark color scheme for GTK 4:

1
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'

(Optional) Set up Nordic Theme

First of all, clone the Nordic Theme from GitHub.

1
2
3
4
5

mkdir -p ~/.themes

git clone <https://github.com/EliverLara/Nordic.git> \
~/.themes/Nordic

Then run:

1
2
gsettings set org.gnome.desktop.interface gtk-theme "Nordic"
gsettings set org.gnome.desktop.wm.preferences theme "Nordic"

Install Applications

Proton VPN

We have two options, either a CLI or a GTK GUI application:

1
2
3
4
5
# For the CLI only
sudo pacman -S proton-vpn-cli

# For the GUI
sudo pacman -S proton-vpn-gtk-app

(optional) Extras

Bruno Bin

1
paru -Syu bruno-bin

Luciole File Manager

1
paru -S luciole-git

Troubleshooting

Limine bootloader shows garbled up text

Edit limine.conf located at /boot/limine.conf. Add this line at the top:

1
interface_resolution: <width>x<height>

Where <width>x<height> refers to the resolution of your display. For example:

1
interface_resolution: 1024x768

Setting up KDE Connect

If after installation KDE connect doesn’t pick up other devices within your local network, and vice versa, you need to configure accept traffic from kde connect specific ports. Read more about it in the KDE UserBase Wiki.

1
2
3
sudo ufw allow proto tcp from 192.168.100.0/24 to any port 1714:1764
sudo ufw allow proto udp from 192.168.100.0/24 to any port 1714:1764
sudo ufw reload

For the above command to work, you need to find the actual IP address subnet information of your network. Run ip --brief address to find out the local IP address. Mine was 192.168.100.x.


Last Updated: December 2, 2026