|
|
|
|
@ -7,6 +7,7 @@ set -uo pipefail
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
DOTFILES_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
|
MODULES="$DOTFILES_DIR/setup/modules"
|
|
|
|
|
APPS="$MODULES/optional-Modules/apps"
|
|
|
|
|
LOG="$HOME/dotfiles-install.log"
|
|
|
|
|
TMP_D="$(mktemp -d)"
|
|
|
|
|
trap 'rm -rf "$TMP_D"' EXIT
|
|
|
|
|
@ -65,8 +66,6 @@ log_sep() {
|
|
|
|
|
printf "\n══════════════════════════════════\n %s\n %s\n" "$1" "$(date)" >> "$LOG"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Run a module script in the terminal (dialog is cleared so stdin/stdout work
|
|
|
|
|
# normally — pacman prompts, yay builds, etc. all function as expected).
|
|
|
|
|
run_module() {
|
|
|
|
|
local label="$1" script="$2"
|
|
|
|
|
STEP=$(( STEP + 1 ))
|
|
|
|
|
@ -88,18 +87,22 @@ run_module() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
count_steps() {
|
|
|
|
|
local c="$1" de="$2"
|
|
|
|
|
local c="$1" de="$2" a="${3:-}"
|
|
|
|
|
TOTAL=0
|
|
|
|
|
[[ "$c" == *"pkg"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"core"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"svc"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"shell"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"de"* && "$de" != "none" ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"py"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"zfs"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"game"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"netdev"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$c" == *"wprs"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"steam"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"vesktop"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"spotify"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"prism"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"nettools"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"k8s"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"python"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"zfs"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
[[ "$a" == *"wprs"* ]] && TOTAL=$(( TOTAL + 1 ))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# ── Preflight ─────────────────────────────────────────────────────────────────
|
|
|
|
|
@ -127,17 +130,12 @@ dialog --backtitle "$BACKTITLE" \
|
|
|
|
|
# ── Component selection ───────────────────────────────────────────────────────
|
|
|
|
|
COMPONENTS=$(dialog --backtitle "$BACKTITLE" \
|
|
|
|
|
--title " Select Components " \
|
|
|
|
|
--checklist "Space toggles · Enter confirms · Esc quits" 22 68 10 \
|
|
|
|
|
--checklist "Space toggles · Enter confirms · Esc quits" 16 68 5 \
|
|
|
|
|
"pkg" "Package managers yay · nvm · rust" on \
|
|
|
|
|
"core" "Core packages 100+ base system packages" on \
|
|
|
|
|
"svc" "Core services NetworkManager · cronie · fail2ban" on \
|
|
|
|
|
"shell" "Shell setup zsh · nvim · yazi · micro · starship" on \
|
|
|
|
|
"de" "Desktop environment (choose on next screen)" off \
|
|
|
|
|
"py" "Python tools pyright · pipx · python-pynvim" off \
|
|
|
|
|
"zfs" "ZFS support zfs-dkms" off \
|
|
|
|
|
"game" "Gaming Steam · Vesktop · Spotify · Prism" off \
|
|
|
|
|
"netdev" "Network dev tools nmap · wireshark · kubectl" off \
|
|
|
|
|
"wprs" "WPRS wprs-git (AUR)" off \
|
|
|
|
|
3>&1 1>&2 2>&3) || { clear; echo "Aborted."; exit 0; }
|
|
|
|
|
|
|
|
|
|
# ── DE selection ──────────────────────────────────────────────────────────────
|
|
|
|
|
@ -152,6 +150,21 @@ if [[ "$COMPONENTS" == *"de"* ]]; then
|
|
|
|
|
3>&1 1>&2 2>&3) || DE="none"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# ── Apps selection ────────────────────────────────────────────────────────────
|
|
|
|
|
SELECTED_APPS=$(dialog --backtitle "$BACKTITLE" \
|
|
|
|
|
--title " Applications " \
|
|
|
|
|
--checklist "Optional applications — installed after base components:" 26 70 11 \
|
|
|
|
|
"steam" "Steam gaming platform" off \
|
|
|
|
|
"vesktop" "Vesktop Discord client + Vencord theme" off \
|
|
|
|
|
"spotify" "Spotify launcher + Spicetify theming" off \
|
|
|
|
|
"prism" "PrismLauncher Minecraft launcher (Flatpak)" off \
|
|
|
|
|
"nettools" "Network tools nmap · wireshark · mtr · bind" off \
|
|
|
|
|
"k8s" "Kubernetes tools kubectl · podman-desktop" off \
|
|
|
|
|
"python" "Python tools pyright · pipx · pynvim" off \
|
|
|
|
|
"zfs" "ZFS zfs-dkms kernel module" off \
|
|
|
|
|
"wprs" "WPRS wprs-git (AUR)" off \
|
|
|
|
|
3>&1 1>&2 2>&3) || SELECTED_APPS=""
|
|
|
|
|
|
|
|
|
|
# ── Confirmation ──────────────────────────────────────────────────────────────
|
|
|
|
|
SUMMARY=""
|
|
|
|
|
[[ "$COMPONENTS" == *"pkg"* ]] && SUMMARY+=" ✦ Package managers (yay, nvm, rust)\n"
|
|
|
|
|
@ -159,20 +172,28 @@ SUMMARY=""
|
|
|
|
|
[[ "$COMPONENTS" == *"svc"* ]] && SUMMARY+=" ✦ Core services\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"shell"*]] && SUMMARY+=" ✦ Shell setup\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"de"* && "$DE" != "none" ]] && SUMMARY+=" ✦ Desktop environment: $DE\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"py"* ]] && SUMMARY+=" ✦ Python tools\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"zfs"* ]] && SUMMARY+=" ✦ ZFS support\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"game"* ]] && SUMMARY+=" ✦ Gaming packages\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"netdev"* ]] && SUMMARY+=" ✦ Network dev tools\n"
|
|
|
|
|
[[ "$COMPONENTS" == *"wprs"* ]] && SUMMARY+=" ✦ WPRS\n"
|
|
|
|
|
|
|
|
|
|
if [[ -n "$SELECTED_APPS" ]]; then
|
|
|
|
|
SUMMARY+="\n Applications:\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"steam"* ]] && SUMMARY+=" ✦ Steam\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"vesktop"* ]] && SUMMARY+=" ✦ Vesktop + Vencord theme\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"spotify"* ]] && SUMMARY+=" ✦ Spotify + Spicetify\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"prism"* ]] && SUMMARY+=" ✦ PrismLauncher\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"nettools"* ]] && SUMMARY+=" ✦ Network tools\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"k8s"* ]] && SUMMARY+=" ✦ Kubernetes tools\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"python"* ]] && SUMMARY+=" ✦ Python tools\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"zfs"* ]] && SUMMARY+=" ✦ ZFS\n"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"wprs"* ]] && SUMMARY+=" ✦ WPRS\n"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
dialog --backtitle "$BACKTITLE" \
|
|
|
|
|
--title " Confirm Installation " \
|
|
|
|
|
--yesno "\n Components to install:\n\n${SUMMARY}\n Log: $LOG\n\n Proceed?" \
|
|
|
|
|
20 62 || { clear; echo "Aborted."; exit 0; }
|
|
|
|
|
24 62 || { clear; echo "Aborted."; exit 0; }
|
|
|
|
|
|
|
|
|
|
count_steps "$COMPONENTS" "$DE"
|
|
|
|
|
count_steps "$COMPONENTS" "$DE" "$SELECTED_APPS"
|
|
|
|
|
|
|
|
|
|
# ── Installation ──────────────────────────────────────────────────────────────
|
|
|
|
|
# ── Installation: base components ─────────────────────────────────────────────
|
|
|
|
|
[[ "$COMPONENTS" == *"pkg"* ]] && run_module "Package Managers" "$MODULES/package-managers.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"core"* ]] && run_module "Core Packages" "$MODULES/core-packages.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"svc"* ]] && run_module "Core Services" "$MODULES/core.sh"
|
|
|
|
|
@ -185,11 +206,16 @@ if [[ "$COMPONENTS" == *"de"* && "$DE" != "none" ]]; then
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
[[ "$COMPONENTS" == *"py"* ]] && run_module "Python Tools" "$MODULES/optional-Modules/python.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"zfs"* ]] && run_module "ZFS" "$MODULES/optional-Modules/zfs.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"game"* ]] && run_module "Gaming Packages" "$MODULES/optional-Modules/gaming-packages.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"netdev"* ]] && run_module "Network Dev Tools" "$MODULES/optional-Modules/network-developer-packages.sh"
|
|
|
|
|
[[ "$COMPONENTS" == *"wprs"* ]] && run_module "WPRS" "$MODULES/optional-Modules/wprs.sh"
|
|
|
|
|
# ── Installation: applications ────────────────────────────────────────────────
|
|
|
|
|
[[ "$SELECTED_APPS" == *"steam"* ]] && run_module "Steam" "$APPS/steam.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"vesktop"* ]] && run_module "Vesktop" "$APPS/vesktop.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"spotify"* ]] && run_module "Spotify" "$APPS/spotify.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"prism"* ]] && run_module "PrismLauncher" "$APPS/prismlauncher.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"nettools"* ]] && run_module "Network Tools" "$APPS/nettools.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"k8s"* ]] && run_module "Kubernetes Tools" "$APPS/k8s.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"python"* ]] && run_module "Python Tools" "$MODULES/optional-Modules/python.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"zfs"* ]] && run_module "ZFS" "$MODULES/optional-Modules/zfs.sh"
|
|
|
|
|
[[ "$SELECTED_APPS" == *"wprs"* ]] && run_module "WPRS" "$MODULES/optional-Modules/wprs.sh"
|
|
|
|
|
|
|
|
|
|
# ── Done ──────────────────────────────────────────────────────────────────────
|
|
|
|
|
dialog --backtitle "$BACKTITLE" \
|
|
|
|
|
|