Files
literate-dotfiles/install.org

17 KiB

Installation

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 to be idempotent (safe to re-run).

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() {
    emacsclient -e "(org-babel-tangle-file \"${DOTFILES}/$1\")" \
        || emacs --batch -l org --eval "(org-babel-tangle-file \"${DOTFILES}/$1\")"
}

Packages

echo "==> Desktop packages"
paru -S --needed \
    i3-wm \
    sxhkd \
    polybar \
    picom \
    dunst \
    rofi rofi-calc dmenu \
    kitty \
    bash bash-completion \
    zoxide \
    nerd-fonts-hack noto-fonts-emoji \
    xorg-xrandr arandr \
    xautocfg \
    arc-gtk-theme xcursor-breeze \
    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

Shell and Terminal

echo "==> Shell and Terminal"
paru -S --needed \
    bash bash-completion zsh \
    kitty \
    tmux

Bash configuration: ~/.bashrc, ~/.bash_profile, ~/.config/bash/, ~/.profile

Fonts

echo "==> Fonts"
paru -S --needed \
    nerd-fonts-hack \
    noto-fonts-emoji

Default fonts: Monospace/Serif/Sans = Hack Nerd Font.

Text Editors

echo "==> Text Editors"
paru -S --needed \
    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 \
    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 \
    i3-wm \
    sxhkd \
    polybar \
    picom \
    dunst \
    rofi rofi-calc dmenu \
    xautocfg \
    xorg-xrandr arandr

File Manager

echo "==> File Manager"
paru -S --needed yazi

Yazi config: yazi.org

Terminal Utilities

echo "==> Terminal Utilities"
paru -S --needed \
    fd ripgrep fzf \
    xclip xsel \
    atool unzip \
    trash-cli \
    man-db \
    neofetch

Browser

echo "==> Browser"
paru -S --needed \
    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 \
    mpv \
    jellyfin-tui \
    nsxiv \
    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)

echo "==> PipeWire"
paru -S --needed \
    pipewire pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse \
    wireplumber \
    pwvucontrol

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 \
    pdf2svg pdftk pdfarranger \
    imagemagick \
    maim flameshot \
    unclutter \
    poppler

Office

echo "==> Office"
paru -S --needed \
    onlyoffice-bin \
    libreoffice-fresh libreoffice-fresh-fr \
    inkscape

System Utilities

echo "==> System Utilities"
paru -S --needed \
    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

GTK Theme

echo "==> GTK Theme"
paru -S --needed \
    lxappearance \
    arc-gtk-theme \
    xcursor-breeze \
    gtk2fontsel

Misc Utilities

echo "==> Misc Utilities"
paru -S --needed \
    screenkey \
    xwallpaper \
    highlight-pointer-git \
    mpd

Systemd Services

Enable custom systemd services (tangle systemd.org first):

systemctl --user enable --now homelab-tunnel
systemctl --user enable --now esrf-tunnel
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 \
    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

Calendar Install Script

Calendar/contact documentation: calendar-contact.org

set -euo pipefail

Packages

echo "==> Calendar and contacts packages"
paru -S --needed \
    vdirsyncer \
    khal \
    khard \
    mu

Systemd Timer

echo "==> Enabling vdirsyncer timer"
systemctl --user enable --now vdirsyncer.timer

LaTeX Install Script

set -euo pipefail

Packages

echo "==> LaTeX packages"
paru -S --needed \
    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 \
    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