Build the exact system that fit my needs.
Prerequisite
The goal is to keep it as minimal as possible, with essential functions.
For basic system installation, refer to my prev post: Arch Linux Install: LUKS + Btrfs + Systemd-boot
Upgrade system first before installing any packages.
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 wl-clipboard \
xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-user-dirs \
wmenu alacritty mako wob grim sway-contrib kanshi
alacritty: terminal emulator, mako: desktop notification.
wob: indicator bar for volume or brightness, ref:
Sway#Graphical indicator bars
, mywob
sway-contrib: area screenshot and window screenshot;
grim: screenshot
kanshi: dynamic output configuration, ref:
Kanshi
, kanshi(5)
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. You may also read i3 User’s Guide for more details.
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 and Win key positions then set Win as the main modifier key.
There’s another benefit about swapping Alt and Win, which is if you running a virtual machine with swaywm, you could keep the vm keys unswapped, then use the same sway keybinding configs without conflicting to your host machine.
For keybinding configs, Use wev to detect key names.
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
PipeWire
Ref: Advanced Linux Sound Architecture , PipeWire
# pacstrap /mnt alsa-utils \
pipewire wireplumber \
pipewire-alsa pipewire-pulse pipewire-jack lib32-pipewire
Volume Control
Ref: No sound in mpv vlc but works in web browser
$ sudo pacman -S pavucontrol
File Manager, Reader
$ sudo pacman -S \
pcmanfm-qt lxqt-archiver p7zip libarchive \
gvfs gvfs-mtp gvfs-afc \
zathura zathura-pdf-mupdf tesseract-data-eng tesseract-data-chi_sim \
imv mpv chromium
zathura pdf,epub viewer,
ref: zathura - archwiki
, tesseract data files
zathura tips: to revert color, use ctrl-r
or :set recolor <true|false>
imv image viewer
mpv video/audio player,
also image viewer via configuration
mpv-image-viewer
Setting default applications: XDG MIME Applications#mimeapps.list , Zathura#Make zathura the default pdf viewer , Desktop entries
The fallback Qt theme is not looking good, for better appearance, check section Qt Theme.
Following settings are for GTK based file managers, like Thunar and Nemo.
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 alacritty
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
Appearance
Necessary appearance settings.
Fonts
# pacstrap /mnt noto-fonts noto-fonts-cjk noto-fonts-emoji \
hicolor-icon-theme
Adjust fallback fonts order, this is for fixing wierd looking of some Chinese characters,
such as “复制”.
Ref: Font configuration#Fontconfig configuration
, Font configuration#Alias
Create "/etc/fonts/local.conf"
with:
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<alias>
<family>sans-serif</family>
<prefer>
<family>Noto Sans</family>
<family>Noto Sans CJK SC</family>
<family>Noto Sans CJK TC</family>
<family>Noto Sans CJK HK</family>
<family>Noto Sans CJK JP</family>
<family>Noto Sans CJK KR</family>
</prefer>
</alias>
<alias>
<family>serif</family>
<prefer>
<family>Noto Serif</family>
<family>Noto Serif CJK SC</family>
<family>Noto Serif CJK TC</family>
<family>Noto Serif CJK HK</family>
<family>Noto Serif CJK JP</family>
<family>Noto Serif CJK KR</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Noto Sans Mono</family>
<family>Noto Sans Mono CJK SC</family>
<family>Noto Sans Mono CJK TC</family>
<family>Noto Sans Mono CJK HK</family>
<family>Noto Sans Mono CJK JP</family>
<family>Noto Sans Mono CJK KR</family>
</prefer>
</alias>
</fontconfig>
Icon Theme
Ref: Icons
$ sudo pacman -S papirus-icon-theme
Change default GTK icon theme:
$ ls /usr/share/icons
$ gsettings set org.gnome.desktop.interface icon-theme Papirus
Ref: GTK#Basic theme configuration , GTK 3 settings on Wayland
For Qt settings check section Qt Theme.
Qt Theme
Install qt6ct
and set environment variables, then restart sway:
$ sudo pacman -S qt6ct
$ echo "export QT_QPA_PLATFORMTHEME=qt6ct" >> ~/.bashrc
Ref: Configuration of Qt 5/6 applications under environments other than KDE Plasma , Not showing functional icons
Not recommending the breeze
theme, the package will install lots of irrelevant KDE components,
which is annoying, this is the most reason I don’t like KDE stuff.
GTK Dark Theme
$ sudo pacman -S gnome-themes-extra
$ ls /usr/share/themes
$ gsettings set org.gnome.desktop.interface gtk-theme Adwaita-dark
Cursor Size
Change cursor size by setting cursor theme, edit "~/.config/sway/config"
with:
seat seat0 xcursor_theme default 32
Ref: Sway#Change cursor theme and size
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