19 KiB
Installation
- Overview
- Prerequisites
- Desktop Install Script
- Main Install Script
- Mail Install Script
- LaTeX Install Script
- Laptop Install Script
- Matlab
- Useful Reference
- Resources
Overview
This file documents how to set up a fresh Arch Linux installation. It tangles several install scripts:
~/install-main.sh— core desktop environment and tools~/install-desktop.sh— tangle and reload the full desktop environment (i3, polybar, sxhkd, picom, rofi, kitty, bash, X11)~/install-mail.sh— mail setup (mbsync, msmtp, neomutt, mu)~/install-calendar.sh— calendar and contacts (vdirsyncer, khal, khard)~/install-music.sh— music server and client (mopidy, ncmpcpp)~/install-latex.sh— LaTeX toolchain (texlive, biber)~/install-laptop.sh— laptop-specific tools (tlp, powertop, thermald)
All scripts use paru -S --needed --noconfirm --noconfirm to be idempotent (safe to re-run) and non-interactive.
Prerequisites
git
sudo pacman -S git
Git configuration: ~/.gitconfig, ~/.gitignore_global
paru - AUR Helper
Must be installed first before running any script:
mkdir -p ~/.local/soft && cd ~/.local/soft
sudo pacman -S --needed base-devel
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si
After that, the paru folder may be removed.
Desktop Install Script
Installs packages and tangles configs for the core desktop environment.
Run this after paru is available to get a working, familiar environment fast.
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
Packages
echo "==> Desktop packages"
paru -S --needed --noconfirm \
i3-wm \
sxhkd \
polybar \
picom \
dunst \
rofi rofi-calc dmenu \
kitty \
bash bash-completion \
zoxide \
xorg-xrandr arandr \
xautocfg \
feh xwallpaper
Tangle Configs
echo "==> Tangling desktop configs"
tangle "xconfig.org" # ~/.Xresources, ~/.xprofile, ~/.config/X11/xinitrc
tangle "bash.org" # ~/.bashrc, ~/.bash_profile, ~/.profile
tangle "kitty.org" # ~/.config/kitty/kitty.conf
tangle "i3.org" # ~/.config/i3/config
tangle "sxhkd.org" # ~/.config/sxhkd/sxhkdrc
tangle "polybar.org" # ~/.config/polybar/config.ini + scripts
tangle "compositor.org" # ~/.config/picom/picom.conf
tangle "rofi.org" # ~/.config/rofi/config.rasi
tangle "binaries.org" # ~/.local/bin/* scripts
tangle "binaries-private.org" # ~/.local/bin/* scripts
Reload
If already running inside i3, restart in place — no need to log out:
echo "==> Reloading desktop"
i3-msg restart 2>/dev/null || echo " (i3 not running, config will apply on next login)"
Main Install Script
set -euo pipefail
DOTFILES="${HOME}/.config/literate-dotfiles"
tangle() {
emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}
Shell and Terminal
echo "==> Shell and Terminal"
paru -S --needed --noconfirm \
bash bash-completion zsh \
kitty \
tmux
Bash configuration: ~/.bashrc, ~/.bash_profile, ~/.config/bash/, ~/.profile
Fonts
echo "==> Fonts"
paru -S --needed --noconfirm \
ttf-hack-nerd \
ttf-sourcecodepro-nerd \
adobe-source-code-pro-fonts \
noto-fonts-emoji
Default fonts: Monospace/Serif/Sans = Hack Nerd Font.
Text Editors
echo "==> Text Editors"
paru -S --needed --noconfirm \
neovim python-pynvim nodejs-neovim \
emacs \
aspell aspell-en aspell-fr
Neovim config: vim.org
Install Doom Emacs framework:
git clone --depth 1 https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
Emacs config: doom.org
Security: GnuPG and Pass
echo "==> GnuPG and Pass"
paru -S --needed --noconfirm \
gnupg gnome-keyring \
pass rofi-pass pass-git-helper
Generate a GPG key:
gpg --full-gen-key
To cache the passphrase, edit ~/.local/share/gnupg/gpg-agent.conf:
default-cache-ttl 60480000
max-cache-ttl 60480000
Initialize the password store:
pass git init
pass git remote add origin https://github.com/tdehaeze/pass.git
SSH
Generate a new SSH key:
ssh-keygen -t ed25519 -C "dehaeze.thomas@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
Window Manager and Desktop
echo "==> Window Manager and Desktop"
paru -S --needed --noconfirm \
i3-wm \
sxhkd \
polybar \
picom \
dunst \
rofi rofi-calc dmenu \
xautocfg \
xorg-xrandr arandr
- i3 config: i3.org
- sxhkd config: sxhkd.org
- polybar config: polybar.org
- compositor config: compositor.org
- notifications config: notifications.org
File Manager
echo "==> File Manager"
paru -S --needed --noconfirm yazi
Yazi config: yazi.org
Terminal Utilities
echo "==> Terminal Utilities"
paru -S --needed --noconfirm \
fd ripgrep fzf \
xclip xsel \
atool unzip \
trash-cli \
man-db \
fastfetch
Browser
echo "==> Browser"
paru -S --needed --noconfirm \
qutebrowser python-adblock pdfjs \
firefox-developer-edition passff-host
Qutebrowser config: qutebrowser.org
Spell checking for qutebrowser:
/usr/share/qutebrowser/scripts/dictcli.py install fr-FR
/usr/share/qutebrowser/scripts/dictcli.py install en-US
Media
echo "==> Media"
paru -S --needed --noconfirm \
mpv \
jellyfin-tui \
nsxiv \
tesseract tesseract-data-eng tesseract-data-fra tesseract-data-osd \
zathura zathura-pdf-mupdf zathura-djvu zathura-ps zathura-cb \
pdfpc \
gst-plugins-ugly gst-plugins-good gst-plugins-base-libs gst-plugins-base gst-plugins-bad gst-libav
Sound (PipeWire)
Core PipeWire packages (required):
echo "==> PipeWire"
paru -S --needed --noconfirm \
pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse \
wireplumber
Optional GUI control (install manually when available):
echo "==> PipeWire GUI (optional)"
paru -S --needed --noconfirm pwvucontrol || echo "pwvucontrol failed, skipping"
Enable PipeWire services:
systemctl --user enable --now pipewire.socket
systemctl --user enable --now pipewire-pulse.socket
systemctl --user enable --now wireplumber.service
PDF and Image Utilities
echo "==> PDF and Image Utilities"
paru -S --needed --noconfirm \
pdf2svg qpdf pdfarranger \
imagemagick \
maim flameshot \
unclutter \
poppler
Office
echo "==> Office"
paru -S --needed --noconfirm \
onlyoffice-bin \
libreoffice-fresh libreoffice-fresh-fr \
inkscape
System Utilities
echo "==> System Utilities"
paru -S --needed --noconfirm \
udiskie \
blueman \
sshfs \
xwallpaper \
sof-firmware \
usbutils \
xautolock \
npm \
xorg-xkill \
syncthing \
wireguard-tools \
gotify-dunst-git \
gomuks \
yt-dlp \
python ipython python-pip
Enable Syncthing:
systemctl --user enable --now syncthing
Misc Utilities
echo "==> Misc Utilities"
paru -S --needed --noconfirm \
xwallpaper \
highlight-pointer-git \
mpd
SSH Keys for Tunnels
Use a single SSH key for all hosts (matches ~/.ssh/config).
KEY_FILE="$HOME/.ssh/id_ed25519"
HOMELAB_OK=1
ESRF_OK=1
# Generate main SSH key if it doesn't exist
if [ ! -f "${KEY_FILE}" ]; then
echo ""
echo "==> Generating main SSH key"
read -p "Generate new SSH key at ${KEY_FILE}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-keygen -t ed25519 -C "thomas@$(hostname)" -f "${KEY_FILE}" -N ""
else
echo "Skipping SSH key generation"
fi
fi
# Deploy key to a remote host if needed
deploy_ssh_key() {
local host_name="$1"
local remote_host="$2"
local remote_port="${3:-22}"
echo ""
echo "==> Checking SSH key for ${host_name}"
# Check if we can connect without password
if ssh -o BatchMode=yes -o ConnectTimeout=5 -p "${remote_port}" "${remote_host}" exit 2>/dev/null; then
echo "SSH key for ${host_name} is already deployed ✓"
return 0
fi
# Prompt to deploy key
read -p "Deploy SSH key to ${remote_host}? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
ssh-copy-id -i "${KEY_FILE}.pub" -p "${remote_port}" "${remote_host}"
return 0
else
echo "Skipping ${host_name} key deployment"
return 1
fi
}
# Setup homelab
deploy_ssh_key "homelab" "homelab" 22
HOMELAB_OK=$?
# Setup ESRF
deploy_ssh_key "esrf" "dehaeze@firewall.esrf.fr" 8022
ESRF_OK=$?
Systemd Services
echo "==> Tangling systemd configs"
tangle "systemd.org"
Enable custom systemd services:
echo "==> Enabling systemd services"
if [ $HOMELAB_OK -eq 0 ]; then
systemctl --user enable --now homelab-tunnel
else
echo " Skipping homelab-tunnel (SSH key not configured)"
fi
if [ $ESRF_OK -eq 0 ]; then
systemctl --user enable --now esrf-tunnel
else
echo " Skipping esrf-tunnel (SSH key not configured)"
fi
systemctl --user enable --now syncthing
After Install
Enable TRIM (SSD only):
sudo systemctl enable --now fstrim.timer
Default Applications
xdg-mime default qutebrowser.desktop x-scheme-handler/http
xdg-mime default qutebrowser.desktop x-scheme-handler/https
Mail Install Script
Mail setup documentation: mail.org
set -euo pipefail
Packages
echo "==> Mail packages"
paru -S --needed --noconfirm \
isync \
msmtp \
neomutt \
mu \
lynx urlview
Initialize mu
echo "==> Initializing mu index"
mu init -m ~/.mail/
mu index
Systemd Timers
echo "==> Enabling mail timers"
systemctl --user enable --now checkmail.timer
systemctl --user enable --now syncmail.timer
LaTeX Install Script
set -euo pipefail
Packages
echo "==> LaTeX packages"
paru -S --needed --noconfirm \
texlive-most tllocalmgr-git \
biber
Custom packages/classes go in ~/.local/share/texmf/tex/latex/local/.
After adding new packages, run sudo texhash.
Laptop Install Script
set -euo pipefail
Power Management
echo "==> Laptop power management"
paru -S --needed --noconfirm \
powertop \
tlp \
thermald
sudo systemctl enable --now tlp
sudo systemctl enable --now tlp-sleep
sudo systemctl enable --now thermald
sudo tlp start
Lid Open/Close
Configure in /etc/systemd/logind.conf.
See Arch Wiki: Power management.
Matlab
Matlab is installed manually via MPM:
wget https://www.mathworks.com/mpm/glnxa64/mpm
chmod +x ./mpm
./mpm install --inputfile=./mpm_input_r2024b.txt
The MPM input file:
########################################################################
## Configuration File for Installing or Downloading R2024b MathWorks Products
########################################################################
destinationFolder=/home/thomas/.local/soft/Matlab/R2024b
########################################################################
## PRODUCTS
########################################################################
#product.5G_Toolbox
#product.AUTOSAR_Blockset
#product.Aerospace_Blockset
#product.Aerospace_Toolbox
#product.Antenna_Toolbox
#product.Audio_Toolbox
#product.Automated_Driving_Toolbox
#product.Bioinformatics_Toolbox
#product.Bluetooth_Toolbox
#product.C2000_Microcontroller_Blockset
#product.Communications_Toolbox
#product.Computer_Vision_Toolbox
product.Control_System_Toolbox
product.Curve_Fitting_Toolbox
#product.DDS_Blockset
#product.DSP_HDL_Toolbox
#product.DSP_System_Toolbox
#product.Data_Acquisition_Toolbox
#product.Database_Toolbox
#product.Datafeed_Toolbox
#product.Deep_Learning_HDL_Toolbox
#product.Deep_Learning_Toolbox
#product.Econometrics_Toolbox
#product.Embedded_Coder
#product.Filter_Design_HDL_Coder
#product.Financial_Instruments_Toolbox
#product.Financial_Toolbox
#product.Fixed-Point_Designer
#product.Fuzzy_Logic_Toolbox
#product.GPU_Coder
#product.Global_Optimization_Toolbox
#product.HDL_Coder
#product.HDL_Verifier
#product.Image_Acquisition_Toolbox
#product.Image_Processing_Toolbox
#product.Industrial_Communication_Toolbox
#product.Instrument_Control_Toolbox
#product.LTE_Toolbox
#product.Lidar_Toolbox
product.MATLAB
product.MATLAB_Coder
product.MATLAB_Compiler
#product.MATLAB_Compiler_SDK
product.MATLAB_Parallel_Server
#product.MATLAB_Production_Server
#product.MATLAB_Report_Generator
#product.MATLAB_Test
#product.MATLAB_Web_App_Server
#product.Mapping_Toolbox
#product.Medical_Imaging_Toolbox
#product.Mixed-Signal_Blockset
#product.Model_Predictive_Control_Toolbox
#product.Model-Based_Calibration_Toolbox
#product.Motor_Control_Blockset
#product.Navigation_Toolbox
product.Optimization_Toolbox
product.Parallel_Computing_Toolbox
#product.Partial_Differential_Equation_Toolbox
#product.Phased_Array_System_Toolbox
#product.Polyspace_Bug_Finder
#product.Polyspace_Bug_Finder_Server
#product.Polyspace_Code_Prover
#product.Polyspace_Code_Prover_Server
#product.Polyspace_Test
#product.Powertrain_Blockset
#product.Predictive_Maintenance_Toolbox
#product.RF_Blockset
#product.RF_PCB_Toolbox
#product.RF_Toolbox
#product.ROS_Toolbox
#product.Radar_Toolbox
#product.Reinforcement_Learning_Toolbox
#product.Requirements_Toolbox
#product.Risk_Management_Toolbox
#product.Robotics_System_Toolbox
product.Robust_Control_Toolbox
#product.Satellite_Communications_Toolbox
#product.Sensor_Fusion_and_Tracking_Toolbox
#product.SerDes_Toolbox
#product.Signal_Integrity_Toolbox
product.Signal_Processing_Toolbox
#product.SimBiology
#product.SimEvents
product.Simscape
#product.Simscape_Battery
#product.Simscape_Driveline
product.Simscape_Electrical
#product.Simscape_Fluids
product.Simscape_Multibody
product.Simulink
#product.Simulink_3D_Animation
#product.Simulink_Check
product.Simulink_Coder
product.Simulink_Compiler
product.Simulink_Control_Design
#product.Simulink_Coverage
#product.Simulink_Design_Optimization
#product.Simulink_Design_Verifier
product.Simulink_Desktop_Real-Time
#product.Simulink_Fault_Analyzer
#product.Simulink_PLC_Coder
product.Simulink_Real-Time
#product.Simulink_Report_Generator
#product.Simulink_Test
#product.SoC_Blockset
#product.Spreadsheet_Link
#product.Stateflow
#product.Statistics_and_Machine_Learning_Toolbox
product.Symbolic_Math_Toolbox
#product.System_Composer
product.System_Identification_Toolbox
#product.Text_Analytics_Toolbox
#product.UAV_Toolbox
#product.Vehicle_Dynamics_Blockset
#product.Vehicle_Network_Toolbox
#product.Vision_HDL_Toolbox
#product.WLAN_Toolbox
#product.Wavelet_Toolbox
#product.Wireless_HDL_Toolbox
#product.Wireless_Testbench
########################################################################
## CHECKSUM
########################################################################
?checksum=UjIwMjRi
Add Matlab binaries to PATH:
ln -s ~/.local/soft/Matlab/R2024b/bin/mex ~/.local/bin
ln -s ~/.local/soft/Matlab/R2024b/bin/matlab ~/.local/bin
ln -s ~/.local/soft/Matlab/R2024b/bin/glnxa64/mlint ~/.local/bin
Fix for gnutls crash on Arch (R2024b), see bbs.archlinux.org #10:
MATLABPATH=$HOME/.local/soft/Matlab/R2024B/bin/glnxa64/
GNUTLSPATH=/tmp/gnutls-3.8.9-1-x86_64.pkg
wget https://archive.archlinux.org/packages/g/gnutls/gnutls-3.8.9-1-x86_64.pkg.tar.zst
mkdir -p "${GNUTLSPATH}"
tar -xvf gnutls-3.8.9-1-x86_64.pkg.tar.zst -C ${GNUTLSPATH}
mkdir "${MATLABPATH}"/gnutls
cp -a "${GNUTLSPATH}"/usr/lib/* "${MATLABPATH}"/gnutls/
cd "${MATLABPATH}"
ln -s gnutls/* ./
See also the Arch Wiki for other issues.
Useful Reference
Readline shortcuts
| Keyboard | Description |
|---|---|
Ctrl+a |
Move to start of line |
Ctrl+e |
Move to end of line |
Alt+b/f |
Move word left/right |
Ctrl+u |
Cut to start of line |
Ctrl+k |
Cut to end of line |
Ctrl+w |
Cut word before cursor |
Ctrl+y |
Paste |
Ctrl+r |
Reverse history search |
Alt+r |
Restore original line |
Archive and Extract
Use apack / aunpack (from atool):
| Command | Usage |
|---|---|
aunpack foobar.tar.gz |
Extract all files from archive |
apack myarchive.zip foo bar |
Create zip archive |
Hardware
dmesg |
Detected hardware and boot messages |
lshw |
Display information on hardware |
lsusb -tv |
Show USB devices |
Network
ip addr show |
Show all network interfaces |
netstat -tulp |
List all active ports |