Some short notes about things I do over and over again when setting up Raspberry Pis with ArchLinux on them.
Formatting the SD card
Prepare the SD card following the instructions here.
Upon the first boot login as user root
with password root
.
Run the pacman initialization and update outdated image:
pacman-key --init pacman-key --populate archlinuxarm pacman -Syu --noconfirm
Change the root password using passwd
to something more safe.
Create your own user and delete useless default user alarm
.
useradd -m <username> passwd <username> userdel alarm
Most probably you want to give yourself some sudo
powers
pacman -S vim sudo echo "<username> ALL=(ALL) ALL" >> /etc/sudoers
Network
Run sudo wifi-menu
to easily setup your wireless connection.
Changing default hostname
hostnamectl set-hostname <new-hostname>
Getting bluetooth up and running
Raspberry Pi 4 comes with built in Bluetooth module.
sudo pacman -S bluez bluez-utils sudo systemctl start bluetooth.service sudo systemctl enable bluetooth.service
With this you have the bluetoothctl
comamnd line interface available. If you want a graphical interface, you could use e.g. blueman
.
Getting access to the AUR repositories
To get access to the large amount of user repositories, install a helper tool for convenient management such as yay
. Do not execute the below commands as root.
sudo pacman -S git base-devel git clone https://aur.archlinux.org/yay.git cd yay/ makepkg -si
Installing XFCE4 as a graphical environment
pacman -S xorg xfce4 xfce4-goodies lightdm lightdm-gtk-greeter
Afterwards you can test the installation of xorg
and xfce4
through the command startxfce4
.
To make it autostart with pi, use
sudo systemctl enable lightdm
XFCE4 compositing and performance
Display compositing in the window manager can be quite resource hungry and since we are running on quite a limited platform, I would disable it. For that go to Settings
–> Window Manager Tweaks
–> Compositor
and disable the option Enable display compositing
.
Resource monitoring with Conky
If you use a graphical user interface, conky is a nice way to monitor your
- install conky
sudo pacman -S conky
- generate a configuration file (tons of examples can be found online)
- start configuration file:
conky -c <path-to-file>
Autostart in XFCE
To autostart conky with XFCE, go to Settings
–> Session and Startup
–> Application Autostart
and add a new startup item with the command above.
Simple example configuration
conky.config = { background = true, use_xft = true, alignment = 'middle_right', minimum_width = 300, minimum_height = 500, update_interval = 1, double_buffer = true, own_window = true, own_window_type = 'desktop', own_window_class = 'Conky', own_window_argb_visual = true, own_window_colour = '#000000', own_window_argb_value = 150, own_window_transparent = true, gap_x = 20 }; conky.text = [[ Kernel ${alignr} ${kernel} Username ${alignr} ${uid_name 1001} Uptime ${alignr} ${uptime} Core 0 ${alignr} ${cpu cpu0} MHz / ${freq} MHz ${cpugraph cpu0 60,500 52ff00 6edd21} Core 1 ${alignr} ${cpu cpu1} MHz / ${freq} MHz ${cpugraph cpu1 60,500 52ff00 6edd21} Core 2 ${alignr} ${cpu cpu2} MHz / ${freq} MHz ${cpugraph cpu2 60,500 52ff00 6edd21} Core 3 ${alignr} ${cpu cpu3} MHz / ${freq} MHz ${cpugraph cpu3 60,500 52ff00 6edd21} Memory ${alignr} ${mem} / ${memmax} ${memgraph 60,500 52ff00 6edd21} Disc read ${alignr} $diskio_read ${diskiograph_read 60,500 52ff00 6edd21} Disc write ${alignr} $diskio_write ${diskiograph_write 60, 500 52ff00 6edd21} ]];