Arch + DWM Setup Attempt
January 15, 2022 · 479 words · One minute · Arch Dwm
Originally, I wanted to replace Manjaro KDE with DWM, but I got stuck at the boot screen, and while trying to fix it, I ended up corrupting the bootloader. So, I decided to go all in, format the entire disk, and try setting up an Arch + DWM development environment. Here, I’m documenting the process to assist with future repairs and device migrations.
This is not a step-by-step guide, but rather a concise record of my journey.
Installing Arch Linux
Preparation
Environment for Installing Arch
To create the installation USB, you’ll need:
- 16GB+ USB drive
- Rufus
- Windows machine
- Arch Linux ISO
After creating the bootable USB, boot from it to start Arch Linux.
Network and Mirrors
Connect to WiFi using iwctl, then update the system clock and modify the Pacman mirror list.
Installing Arch Linux
Disk Partitioning
The disk should be divided into three main parts: Boot, Swap, and Root partitions.
| Mount Point | Partition | Partition Type | Suggested Size |
|---|---|---|---|
/mnt/boot or /mnt/efi |
/dev/*efi_system_partition* |
EFI System Partition | At least 260 MiB |
[SWAP] |
/dev/*swap_partition* |
Linux swap | More than 512 MiB |
/mnt |
/dev/*root_partition* |
Linux x86-64 Root (/) | Remaining Space |
fdisk -l # View disk information
cfdisk /dev/nvme # Partition the disk
Formatting Partitions
mkfs.ext4 ${root}
mkswap ${swap}
mkfs.fat -F 32 ${efi}
Configuring Partitions and Installing the System
- Mount Root:
mount /dev/${root_partition} /mnt - Mount EFI:
mount /dev/${efi_partition} /mnt/boot/efi - Activate Swap:
swapon /dev/${swap_partition} - Install Kernel and Essential Packages:
pacstrap /mnt base linux linux-firmware - Generate
fstabConfig:genfstab -U /mnt >> /mnt/etc/fstab(check for correctness)
The system should now be installed, but there is no bootloader, so we need to install GRUB.
Other Configurations Before Booting
- Change root to the new system:
mount /dev/${root_partition} /mnt
arch-chroot /mnt
-
Set timezone and sync time.
-
Configure language by editing locale.gen and locale.conf.
-
Network configuration: set hostname and hosts.
-
Set the root password.
-
Install the GRUB bootloader and EFI tools:
grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB -
Install and start iwd to connect to WiFi.
-
Boot into Arch Linux.
Post-Boot Configuration
Install Essential Software
| Purpose | Software |
|---|---|
| Bluetooth | bluetoothctl |
| Network | iwd |
| Daily Use | nvim, ranger, zsh |
| Sound | alsamixer |
| Input Method | fcitx5-im, fcitx5-chinese-addons |
| Proxy | clash |
Installing the Desktop Environment
Install Xorg
Xorg provides an open-source implementation of the X window system, which is the basis for graphical user interfaces.
Install: xorg-server, xorg-apps, xrandr, xinit.
Install Desktop Companion Software
I used the Suckless tiling window management suite: dwm, slock, st, dmenu, slim, slstatus.
Configure .xinitc and .xprofile
Add to .xinitc:
# .xinitc
fcitx5 &
xautolock -time 10 -locker slock &
autorandr -l home
picom -b
feh --bg-fill --randomize /home/noneback/Picture/wallpaper/*.jpg
exec slstatus &
exec dwm
# .xprofile
export INPUT_METHOD=fcitx5
export GTK_IM_MODULE=fcitx5
export QT_IM_MODULE=fcitx5
export XMODIFIERS=@im=fcitx5
Customization and Usability
| Purpose | Software |
|---|---|
| Wallpaper | feh |
| Window Effects | picom |
| Screen Lock | xautolock |
| Multi-Screen | autorandr |
| Power Saving | tlp |
Additional Notes
For more detailed instructions, please refer to the official installation documentation.