dotfiles/setup.sh
Martin Büchler f20f7179ef chore(hyprland): remove wl-clipboard-history and autostart usage; add network-manager-applet; ensure both JetBrains Mono font variants are installed
chore(setup): unify device profile detection and symlink logic via PROFILE env var

🤖 Generated with opencode.ai

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-08 11:54:58 +02:00

34 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
# Dotfiles setup script for Arch Linux using paru
set -e
#!/usr/bin/env bash
# Dotfiles setup script for Arch Linux using paru
set -e
# Device profile detection (unified via host-profiles.conf)
HOSTNAME=$(hostname)
PROFILE=""
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
if [ -f "$DOTFILES_DIR/host-profiles.conf" ]; then
PROFILE=$(awk -F= -v h="$HOSTNAME" '$1==h{print $2}' "$DOTFILES_DIR/host-profiles.conf")
fi
if [ -z "$PROFILE" ]; then
echo "ERROR: No profile mapping found for hostname '$HOSTNAME' in $DOTFILES_DIR/host-profiles.conf"
exit 1
fi
export PROFILE
echo "Using device profile: $PROFILE"
# Find, sort, and run all modules in the modules directory
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MODULES=( $(find "$SCRIPT_DIR/modules" -maxdepth 1 -type f -name "*.sh" | sort) )
COUNT=${#MODULES[@]}
for i in "${!MODULES[@]}"; do
MODULE="${MODULES[$i]}"
STEP=$((i+1))
BASENAME=$(basename "$MODULE")
echo "[$STEP/$COUNT] Running $BASENAME..."
source "$MODULE"
done