dotfiles/setup.sh
Martin Büchler 7d13e6ff1c chore: initial commit of all dotfiles, configs, and setup scripts
Includes modular setup, device profile support, and documentation.

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
2025-08-07 23:05:28 +02:00

33 lines
906 B
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
if [ -z "$DOTFILES_DEVICE" ]; then
echo "Select device profile:"
select profile in "laptop" "desktop"; do
DOTFILES_DEVICE="$profile"
export DOTFILES_DEVICE
echo "Using device profile: $DOTFILES_DEVICE"
break
done
else
echo "Using device profile from environment: $DOTFILES_DEVICE"
fi
# 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