Build the exact system that fit my need.

The goal is to keep it as minimal as possible, with essential functions.

Basic System

Refer to my prev post: Arch Linux with LUKS Btrfs and Systemd-boot

Upgrade System

Upgrade first. Ref: System maintenance#Avoid certain pacman commands

$ sudo pacman -Syu

Sway

Ref: Sway , XDG Desktop Portal , XDG user directories , Desktop_notifications

$ sudo pacman -S \
    sway swaylock swayidle swaybg xorg-xwayland \
    xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-user-dirs \
    wmenu foot foot-terminfo mako wob grim sway-contrib

foot: terminal emulator, mako: desktop notification.
wob: indicator bar for volume or brightness. Ref: Sway#Graphical indicator bars , wob.
grim: screenshot. sway-contrib: area screenshot and window screenshot.\

Initialize sway config file:

$ mkdir -p ~/.config/sway
$ sudo cp /etc/sway/config ~/.config/sway/
$ sudo chown $USER:$USER ~/.config/sway/config

The default config is a good start point, it has elaborate comments. Then you may read i3 User’s Guide for more details.

Polkit

Tools like ventoy need polkit to evaluate privilege.
Ref: polkit

$ sudo pacman -S polkit lxqt-policykit

Autostart with sway, edit "~/.config/sway/config" with:

exec lxqt-policykit-agent

File Manager & Viewer

Ref: PCManFM , GVFS

$ sudo pacman -S \
    pcmanfm-qt lxqt-archiver p7zip libarchive \
    gvfs gvfs-mtp gvfs-smb gvfs-wsdd gvfs-afc gvfs-dnssd \
    imv zathura foliate mpv chromium

imv image viewer, zathura pdf viewer, foliate ebook reader
mpv video/audio player, also image viewer via configuration mpv-image-viewer

Default applications: XDG MIME Applications#mimeapps.list , Zathura#Make zathura the default pdf viewer , Desktop entries

Disable GTK recent files. Ref: gsettings

$ gsettings set org.cinnamon.desktop.privacy remember-recent-files false
$ rm ~/.local/share/recently-used.xbel
$ ln -s /dev/null ~/.local/share/recently-used.xbel

Change the default terminal emulator for GTK based desktop

$ gsettings set org.cinnamon.desktop.default-applications.terminal exec foot

Volume Control

Ref: No sound in mpv vlc but works in web browser

$ sudo pacman -S pavucontrol

Input Method

Ref: Fcitx5 , Using Fcitx 5 on Wayland , sway(5)

$ sudo pacman -S fcitx5-im fcitx5-rime

Edit ".bashrc" with:

export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx

Autostart with sway, edit "~/.config/sway/config" with:

exec fcitx5 -d -r

Fix fcitx5 not working for chromium on wayland, enter "chrome://flags" from chromium address bar, search for "wayland", edit:

Preferred Ozone platform: Auto
Wayland text-input-v3: Enabled

Keymap

Ref: Sway#Keymap

Remap CapsLock to Ctrl, swap Alt with Win, and enable NumLock.
Edit "~/.config/sway/config" with:

input type:keyboard {
    xkb_options 'ctrl:nocaps,altwin:swap_alt_win'
    xkb_numlock enabled
}

The position of left Alt key is the best for modifier key, but some applications have useful default shortcuts combined with Alt key, such as Alt+b Alt+f in bash for jumping backward and forward word by word. So I swap Alt with Win then set Win as the main modifier key.

Keybindings

Use wev to detect key names.

Inhibit Idle

Implement functions like gnome-shell-extension-caffeine.

Create "~/.config/sway/inhibit-idle.sh" with:

#!/usr/bin/env bash

idle_status() {
    swaymsg -t get_tree -r | grep -q "inhibit_idle.*true" && \
        echo "CAFFEINE" || echo ""
}

idle_toggle() {
    if [[ "$(status)" != "CAFFEINE" ]]; then
        swaymsg [all] inhibit_idle open
    else
        swaymsg [all] inhibit_idle none
    fi
}

case "${1}" in
    status)
        idle_status
        ;;
    toggle)
        idle_toggle
        ;;
    *)
        echo "Usage: $(basename $0) [status|toggle]"
        ;;
esac

Make it executable, then bind key combo to it in "~/.config/sway/config" like this:

bindsym $mod+z exec ~/.config/sway/inhibit-idle.sh toggle

Use "~/.config/sway/inhibit-idle.sh status" to get caffeine status, add it to swaybar script as an indicator.

Appearance

Tweaking some eye candy stuff.

Fonts

Ref: Font configuration , Font configuration#Alias , Pango.FontDescription

Programming font:

$ sudo pacman -S ttf-jetbrains-mono ttf-nerd-fonts-symbols

Sway font config, edit "~/.config/sway/config" with:

font [pango:]<font>

bar {
    font [pango:]<font>
}

Icon Theme

Ref: Icons

$ sudo pacman -S adwaita-icon-theme

Change default GTK icon theme:

$ ls /usr/share/icons
$ gsettings set org.gnome.desktop.interface icon-theme Adwaita

Ref: GTK#Basic theme configuration , GTK 3 settings on Wayland

Set cursor theme, edit "~/.config/sway/config" with:

seat seat0 xcursor_theme Adwaita 32

Ref: Sway#Change cursor theme and size

Plymouth Theme

Collection: adi1090x/plymouth-themes

$ tar xf spinner_alt.tar.gz
$ sudo cp -r spinner_alt /usr/share/plymouth/themes/
$ sudo plymouth-set-default-theme -l
$ sudo plymouth-set-default-theme -R spinner_alt

Ref: Plymouth#Install new themes

GPU

AMD. Ref: AMDGPU#Installation

$ sudo pacman -S lib32-mesa vulkan-radeon lib32-vulkan-radeon

Intel. Ref: Intel graphics#Installation

$ sudo pacman -S lib32-mesa vulkan-intel lib32-vulkan-intel

Hardware Video Acceleration

Ref: Hardware video acceleration

Alder Lake:

$ sudo pacman -S intel-media-driver

Bluetooth

Ref: Bluetooth

$ sudo pacman -S bluez bluez-utils
$ sudo systemctl enable --now bluetooth

Pairing

$ bluetoothctl
[bluetoothctl]# scan on
[bluetoothctl]# pair <MAC_ADDRESS> (tab completion works)

Troubleshooting:
Reboot computer when this error occurred: bluetoothctl: No default controller available

Printer

Install cups packages:

$ sudo pacman -S cups cups-pdf
$ sudo systemctl enable --now cups

Install printer driver if needed, for example:

$ yay -S brlaser

Ref: AUR helpers , yay

The CUPS server can be fully administered through the web interface, and there’s documentation for adding printer http://localhost:631/help/admin.html.

Ref: CUPS