Files
dotfiles/install.sh
2026-03-07 21:16:43 +01:00

96 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# install.sh: Install dependencies and stow all packages.
# Run this after cloning on a new machine.
set -euo pipefail
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
# ---------------------------------------------------------------------------
# Dependencies (Fedora)
# ---------------------------------------------------------------------------
DNF_PACKAGES=(
stow
# sway ecosystem
swayidle
# bar & notifications
mako
libnotify # notify-send
# terminal & launcher
fuzzel
# audio & display
wireplumber # wpctl
pipewire-utils # pactl
brightnessctl
alsa-utils # speaker-test
# screen recording
wf-recorder
slurp
zenity
ffmpeg # needs RPM Fusion: https://rpmfusion.org
# misc
jq
firefox
)
echo "Installing dnf packages..."
sudo dnf install -y "${DNF_PACKAGES[@]}"
# ---------------------------------------------------------------------------
# Packages not in Fedora repos — install manually if missing
# ---------------------------------------------------------------------------
warn_missing() {
local cmd="$1" msg="$2"
if ! command -v "$cmd" &>/dev/null; then
echo "WARNING: '$cmd' not found — $msg"
fi
}
warn_missing autotiling "install via pip: pip install --user autotiling"
warn_missing eww "install from https://github.com/elkowar/eww/releases"
warn_missing wezterm "install from https://wezfurlong.org/wezterm/install/linux.html"
# ---------------------------------------------------------------------------
# NPM packages
# ---------------------------------------------------------------------------
echo ""
echo "Installing npm packages..."
npm install -g @mariozechner/pi-coding-agent
# ---------------------------------------------------------------------------
# Fonts
# ---------------------------------------------------------------------------
FONT_DIR="$HOME/.local/share/fonts/JetBrainsMono"
if [[ ! -d "$FONT_DIR" ]]; then
echo ""
echo "Installing JetBrains Mono Nerd Font..."
TMP="$(mktemp -d)"
curl -fLo "$TMP/JetBrainsMono.zip" \
"https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip"
mkdir -p "$FONT_DIR"
unzip -q "$TMP/JetBrainsMono.zip" -d "$FONT_DIR"
rm -rf "$TMP"
fc-cache -f "$FONT_DIR"
echo "Font installed."
else
echo "JetBrains Mono Nerd Font already installed, skipping."
fi
# ---------------------------------------------------------------------------
# Stow all packages
# ---------------------------------------------------------------------------
echo ""
echo "Stowing dotfiles..."
for PACKAGE in "$DOTFILES_DIR"/*/; do
PACKAGE="$(basename "$PACKAGE")"
echo " $PACKAGE"
stow --dir="$DOTFILES_DIR" --target="$HOME" --restow "$PACKAGE"
done
echo "Done."