Rearrange install scripts.

This commit is a preparation for detection about
whether a dist-<DISTRO_ID>/ folder is outdated.
This commit is contained in:
clsty
2025-10-02 16:38:43 +08:00
parent 0ee141493f
commit 918997acfa
12 changed files with 37 additions and 27 deletions
+5 -5
View File
@@ -3,7 +3,7 @@ cd "$(dirname "$0")"
export base="$(pwd)"
source ./scriptdata/environment-variables.sh
source ./scriptdata/functions.sh
source ./scriptdata/installers.sh
source ./scriptdata/package-installers.sh
source ./scriptdata/options.sh
prevent_sudo_or_root
@@ -11,19 +11,19 @@ set -e
#####################################################################################
# 0. Before we start
source ./scriptdata/install-greeting.sh
source ./scriptdata/0.install-greeting.sh
#####################################################################################
if [[ "${SKIP_ALLDEPS}" != true ]]; then
printf "${STY_CYAN}[$0]: 1. Install dependencies\n${STY_RESET}"
source ./scriptdata/install-deps.sh
source ./scriptdata/1.install-deps-selector.sh
fi
#####################################################################################
if [[ "${SKIP_ALLSETUPS}" != true ]]; then
printf "${STY_CYAN}[$0]: 2. Setup for permissions/services etc\n${STY_RESET}"
source ./scriptdata/install-setups.sh
source ./scriptdata/2.install-setups-selector.sh
fi
#####################################################################################
if [[ "${SKIP_ALLFILES}" != true ]]; then
printf "${STY_CYAN}[$0]: 3. Copying config files\n${STY_RESET}"
source ./scriptdata/install-files.sh
source ./scriptdata/3.install-files.sh
fi
@@ -34,6 +34,7 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo
if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=nix
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Nix will be used to install dependencies.\n"
@@ -42,25 +43,27 @@ if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-deps-nix.sh
source ./dist-${TARGET_ID}/install-deps.sh
elif [[ "$OS_DISTRO_ID" =~ ^(arch|endeavouros)$ ]]; then
TARGET_ID=arch
printf "${STY_GREEN}"
printf "===INFO===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./scriptdata/install-deps-arch.sh will be used.\n"
printf "./dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-deps-arch.sh
source ./dist-${TARGET_ID}/install-deps.sh
elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then
elif [[ -f "./dist-${OS_DISTRO_ID}/install-deps.sh" ]]; then
TARGET_ID=${OS_DISTRO_ID}
printf "${STY_PURPLE}"
printf "===NOTICE===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh detected and will be used.\n"
printf "./dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "This file is provided by the community.\n"
printf "It is not officially supported by github:end-4/dots-hyprland .\n"
printf "${STY_BG_PURPLE}"
@@ -70,36 +73,38 @@ elif [[ -f "./scriptdata/install-deps-${OS_DISTRO_ID}.sh" ]]; then
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-deps-${OS_DISTRO_ID}.sh
source ./dist-${TARGET_ID}/install-deps.sh
elif [[ "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
TARGET_ID=arch
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./scriptdata/install-deps-arch.sh will be used.\n"
printf "./dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "Ideally, it should also work for your distro.\n"
printf "Still, there is a chance that it not works as expected or even fails.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-deps-arch.sh
source ./dist-${TARGET_ID}/install-deps.sh
else
TARGET_ID=fallback
printf "${STY_RED}"
printf "${STY_BOLD}===URGENT===${STY_RED}\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./scriptdata/install-deps-${OS_DISTRO_ID}.sh not found.\n"
printf "./scriptdata/install-deps-fallback.sh will be used.\n"
printf "./dist-${OS_DISTRO_ID}/install-deps.sh not found.\n"
printf "./dist-${TARGET_ID}/install-deps.sh will be used.\n"
printf "1. It may disrupt your system and will likely fail without your manual intervention.\n"
printf "2. It's WIP and only contains small number of dependencies far from enough.\n"
printf "Proceed only at your own risk.\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-deps-fallback.sh
source ./dist-${TARGET_ID}/install-deps.sh
fi
@@ -16,6 +16,7 @@ export OS_DISTRO_ID_LIKE=$(awk -F'=' '/^ID_LIKE=/ { gsub("\"","",$2); print tolo
if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
TARGET_ID=nix
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Nix will be used to do setups.\n"
@@ -24,25 +25,27 @@ if [[ "$INSTALL_VIA_NIX" == "true" ]]; then
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-setups-nix.sh
source ./dist-${TARGET_ID}/install-setups.sh
elif [[ "$OS_DISTRO_ID" == "arch" ]]; then
TARGET_ID=arch
printf "${STY_GREEN}"
printf "===INFO===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./scriptdata/install-setups-arch.sh will be used.\n"
printf "./dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-setups-arch.sh
source ./dist-${TARGET_ID}/install-setups.sh
elif [[ -f "./scriptdata/install-setups-${OS_DISTRO_ID}.sh" ]]; then
elif [[ -f "./dist-${OS_DISTRO_ID}/install-setups.sh" ]]; then
TARGET_ID=${OS_DISTRO_ID}
printf "${STY_PURPLE}"
printf "===NOTICE===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "./scriptdata/install-setups-${OS_DISTRO_ID}.sh detected and will be used.\n"
printf "./dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "This file is provided by the community.\n"
printf "It is not officially supported by github:end-4/dots-hyprland .\n"
printf "${STY_BG_PURPLE}"
@@ -52,36 +55,38 @@ elif [[ -f "./scriptdata/install-setups-${OS_DISTRO_ID}.sh" ]]; then
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-setups-${OS_DISTRO_ID}.sh
source ./dist-${TARGET_ID}/install-setups.sh
elif [[ "$OS_DISTRO_ID_LIKE" == "arch" || "$OS_DISTRO_ID" == "cachyos" ]]; then
TARGET_ID=arch
printf "${STY_YELLOW}"
printf "===WARNING===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./scriptdata/install-setups-arch.sh will be used.\n"
printf "./dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "Ideally, it should also work for your distro.\n"
printf "Still, there is a chance that it not works as expected or even fails.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-setups-arch.sh
source ./dist-${TARGET_ID}/install-setups.sh
else
TARGET_ID=fallback
printf "${STY_RED}"
printf "===WARNING===\n"
printf "Detected distro ID: ${OS_DISTRO_ID}\n"
printf "Detected distro ID_LIKE: ${OS_DISTRO_ID_LIKE}\n"
printf "./scriptdata/install-setups-${OS_DISTRO_ID}.sh not found.\n"
printf "./scriptdata/install-setups-fallback.sh will be used.\n"
printf "./dist-${OS_DISTRO_ID}/install-setups.sh not found.\n"
printf "./dist-${TARGET_ID}/install-setups.sh will be used.\n"
printf "It might fail or disrupt your system.\n"
printf "Proceed only at your own risk.\n"
printf "\n"
printf "${STY_RESET}"
pause
source ./scriptdata/install-setups-fallback.sh
source ./dist-${TARGET_ID}/install-setups.sh
fi