This commit is contained in:
alvinlollo
2026-07-17 19:48:33 +10:00
parent 7541db9354
commit 0112c73e02
+177 -171
View File
@@ -3,12 +3,12 @@
PreviousWD=$(pwd) PreviousWD=$(pwd)
skip_watermark=false skip_watermark=false
if [ "$1" = "--skip-watermark" ]; then if [ "$1" = "--skip-watermark" ]; then
skip_watermark=true skip_watermark=true
fi fi
if [ "$skip_watermark" = false ]; then if [ "$skip_watermark" = false ]; then
clear clear
echo ' echo '
____ _ _ _ _ _ ____ _ _ _ _ _
| __ ) _ _ __ _| |_ _(_)_ __ | | ___ | | | ___ | __ ) _ _ __ _| |_ _(_)_ __ | | ___ | | | ___
| _ \| | | | / _ | \ \ / / | _ \| |/ _ \| | |/ _ \ | _ \| | | | / _ | \ \ / / | _ \| |/ _ \| | |/ _ \
@@ -36,65 +36,71 @@ trap error_handler ERR
sudo pacman -Syu git zsh curl wget libnewt --noconfirm --needed sudo pacman -Syu git zsh curl wget libnewt --noconfirm --needed
if command -v pacman >/dev/null; then if command -v pacman >/dev/null; then
echo "pacman detected. Installing prerequisites" echo "pacman detected. Installing prerequisites"
sudo pacman -Syu git zsh curl wget whiptail --noconfirm --needed sudo pacman -Syu git zsh curl wget whiptail --noconfirm --needed
fi fi
if command -v apt >/dev/null; then if command -v apt >/dev/null; then
echo "apt detected. Installing prerequisites" echo "apt detected. Installing prerequisites"
sudo apt update sudo apt update
sudo apt full-upgrade -y sudo apt full-upgrade -y
sudo apt install git zsh curl wget whiptail -y sudo apt install git zsh curl wget whiptail -y
fi fi
# Ensure whiptail is installed # Ensure whiptail is installed
if ! command -v whiptail >/dev/null; then if ! command -v whiptail >/dev/null; then
echo "whiptail is not installed. Installing it now..." echo "whiptail is not installed. Installing it now..."
if command -v pacman >/dev/null; then
echo "pacman detected. Installing prerequisites"
sudo pacman -S whiptail --noconfirm || {
echo "Failed to install whiptail. Exiting."
exit 1
}
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi
if command -v apt >/dev/null; then
echo "apt detected. Installing prerequisites"
sudo apt install whiptail -y || {
echo "Failed to install whiptail. Exiting."
exit 1
}
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi
if command -v pacman >/dev/null; then
echo "pacman detected. Installing prerequisites"
sudo pacman -S whiptail --noconfirm || { echo "Failed to install whiptail. Exiting."; exit 1; }
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi
if command -v apt >/dev/null; then
echo "apt detected. Installing prerequisites"
sudo apt install whiptail -y || { echo "Failed to install whiptail. Exiting."; exit 1; }
# Reload zsh if it exists
if command -v zsh -h >/dev/null; then
source ~/.zshrc
fi
# Reload Bash
source ~/.bashrc
fi
fi fi
# Options for the whiptail menu # Options for the whiptail menu
OPTIONS=( OPTIONS=(
1 "Run zsh setup script" ON 1 "Run zsh setup script" ON
2 "Run LazyVim setup script" OFF 2 "Run LazyVim setup script" OFF
3 "Install Docker" OFF 3 "Install Docker" OFF
4 "Install Pacman Packages" ON 4 "Install Pacman Packages" ON
5 "Install Yay and AUR Packages" ON 5 "Install Yay and AUR Packages" ON
6 "Install affinity with GUI" OFF 6 "Install affinity with GUI" OFF
) )
CHOICE=$(whiptail --title "Installation Options" --checklist \ CHOICE=$(whiptail --title "Installation Options" --checklist \
"Choose components to install:" 20 78 10 \ "Choose components to install:" 20 78 10 \
"${OPTIONS[@]}" 3>&1 1>&2 2>&3) "${OPTIONS[@]}" 3>&1 1>&2 2>&3)
exitstatus=$? exitstatus=$?
if [ $exitstatus = 0 ]; then if [ $exitstatus = 0 ]; then
echo "User selected: $CHOICE" echo "User selected: $CHOICE"
else else
echo "User cancelled installation." echo "User cancelled installation."
exit 1 exit 1
fi fi
# Fail on any command. # Fail on any command.
@@ -102,134 +108,134 @@ set -eu pipefail
# Process selected options # Process selected options
for selection in $CHOICE; do for selection in $CHOICE; do
clean_selection=$(echo $selection | tr -d '"') clean_selection=$(echo "$selection " | tr -d '"')
case $clean_selection in case $clean_selection in
"1") "1")
echo "Running zsh setup script..." echo "Running zsh setup script..."
# Runs local script unless it does not exist or fails # Runs local script unless it does not exist or fails
if [[ -f "zsh.sh" ]]; then if [[ -f "zsh.sh" ]]; then
echo "Found local script, running..." echo "Found local script, running..."
bash zsh.sh --skip-watermark bash zsh.sh --skip-watermark
else else
bash "$(curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/zsh.sh)" --skip-watermark bash "$(curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/zsh.sh)" --skip-watermark
fi fi
;; ;;
"2") "2")
echo "Running LazyVim setup script..." echo "Running LazyVim setup script..."
# Runs local script unless it does not exist or fails # Runs local script unless it does not exist or fails
if [[ -f "LazyVim.sh" ]];then if [[ -f "LazyVim.sh" ]]; then
echo "Found local script, running..." echo "Found local script, running..."
bash LazyVim.sh bash LazyVim.sh
else else
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/LazyVim.sh | bash curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/LazyVim.sh | bash
fi fi
;; ;;
"3") "3")
echo "Installing Docker..." echo "Installing Docker..."
if ! command -v docker >/dev/null; then if ! command -v docker >/dev/null; then
echo "docker is NOT installed. Installing..." echo "docker is NOT installed. Installing..."
curl -fsSL https://get.docker.com | sh curl -fsSL https://get.docker.com | sh
sudo usermod -aG docker $USER sudo usermod -aG docker "$USER"
else else
sudo usermod -aG docker $USER sudo usermod -aG docker "$USER"
echo "Docker is already installed." echo "Docker is already installed."
echo "+ sleep 10" && sleep 10 echo "+ sleep 10" && sleep 10
fi fi
;; ;;
"4") "4")
echo "Installing Pacman Packages..." echo "Installing Pacman Packages..."
# Check if pacman binary is installed # Check if pacman binary is installed
if command -v pacman </dev/null; then if command -v pacman </dev/null; then
echo "Cannot proceed: pacman binary not found" echo "Cannot proceed: pacman binary not found"
exit 1 # exit with an error exit 1 # exit with an error
fi fi
# Install pacman packages # Install pacman packages
# Runs local script unless it does not exit or fails # Runs local script unless it does not exit or fails
if [[ -f "./configs/PackagesPacman.txt" ]]; then if [[ -f "./configs/PackagesPacman.txt" ]]; then
echo "Found local config" echo "Found local config"
cat ./configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm cat ./configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm
elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm; then elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install Pacman packages. You can try running it manually:" echo "Failed to install Pacman packages. You can try running it manually:"
echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm" echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "+ sleep 10" && sleep 10 echo "+ sleep 10" && sleep 10
fi fi
;; ;;
"5") "5")
echo "Installing Yay and Yay Packages..." echo "Installing Yay and Yay Packages..."
# Check for pacman before installing yay # Check for pacman before installing yay
if command -v pacman </dev/null; then if command -v pacman </dev/null; then
echo "Cannot proceed: Not a arch based system" echo "Cannot proceed: Not a arch based system"
exit 1 # Exit with an error exit 1 # Exit with an error
fi fi
# Install yay prerequisites # Install yay prerequisites
if ! sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc; then if ! sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install prerequisite packages for Yay. You can try running it manually:" echo "Failed to install prerequisite packages for Yay. You can try running it manually:"
echo "sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc" echo "sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl golang fakeroot debugedit make gcc"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error exit 1 # exit with an error
fi fi
# Check if yay binary exists # Check if yay binary exists
if ! command -v yay >/dev/null; then if ! command -v yay >/dev/null; then
echo "yay is NOT installed. Running installation commands..." echo "yay is NOT installed. Running installation commands..."
if ! git clone https://aur.archlinux.org/yay.git /tmp/yay_install; then if ! git clone https://aur.archlinux.org/yay.git /tmp/yay_install; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to clone yay repository. You can try running it manually:" echo "Failed to clone yay repository. You can try running it manually:"
echo "git clone https://aur.archlinux.org/yay.git /tmp/yay_install" echo "git clone https://aur.archlinux.org/yay.git /tmp/yay_install"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error exit 1 # exit with an error
elif ! (cd /tmp/yay_install && makepkg -si --noconfirm); then elif ! (cd /tmp/yay_install && makepkg -si --noconfirm); then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to build and install yay. You can try running it manually:" echo "Failed to build and install yay. You can try running it manually:"
echo "cd /tmp/yay_install && makepkg -si --noconfirm" echo "cd /tmp/yay_install && makepkg -si --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
exit 1 # exit with an error exit 1 # exit with an error
fi fi
cd $PreviousWD cd "$PreviousWD"
rm -rf /tmp/yay_install rm -rf /tmp/yay_install
else else
echo "Yay is already installed." echo "Yay is already installed."
fi fi
# Install yay packages # Install yay packages
# Runs local script unless it does no exist or fails # Runs local script unless it does no exist or fails
if [[ -f "./config/PackagesYay.txt" ]]; then if [[ -f "./config/PackagesYay.txt" ]]; then
echo "Found local config" echo "Found local config"
cat ./config/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm cat ./config/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm
elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm; then elif ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm; then
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "Failed to install Yay packages. You can try running it manually:" echo "Failed to install Yay packages. You can try running it manually:"
echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm" echo "curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean None --answerdiff None - --noconfirm"
echo "--------------------------------------------------------------------" echo "--------------------------------------------------------------------"
echo "+ sleep 10" && sleep 10 echo "+ sleep 10" && sleep 10
fi fi
;; ;;
"6") "6")
echo "Installing GUI dependencies" echo "Installing GUI dependencies"
if command -v pacman </dev/null; then if command -v pacman </dev/null; then
echo "Pacman found" echo "Pacman found"
sudo pacman -S python-pyqt6 --noconfirm --needed sudo pacman -S python-pyqt6 --noconfirm --needed
fi fi
if command -v dnf </dev/null; then if command -v dnf </dev/null; then
echo "dnf found" echo "dnf found"
sudo dnf install python3-pyqt6 sudo dnf install python3-pyqt6
fi fi
if command -v apt </dev/null; then if command -v apt </dev/null; then
echo "apt found" echo "apt found"
sudo apt install python3-pyqt6 -y sudo apt install python3-pyqt6 -y
fi fi
echo "Install affinity with ryzendew's gui installer" echo "Install affinity with ryzendew's gui installer"
echo "You must manually select to install in the GUI" echo "You must manually select to install in the GUI"
echo "Github repo: https://github.com/ryzendew/Linux-Affinity-Installer" echo "Github repo: https://github.com/ryzendew/Linux-Affinity-Installer"
echo "+ 10 sleep" echo "+ 10 sleep"
sleep 10 sleep 10
curl -sSL https://raw.githubusercontent.com/ryzendew/AffinityOnLinux/refs/heads/main/AffinityScripts/AffinityLinuxInstaller.py | python3 curl -sSL https://raw.githubusercontent.com/ryzendew/AffinityOnLinux/refs/heads/main/AffinityScripts/AffinityLinuxInstaller.py | python3
;; ;;
*) *)
echo "Invalid option selected: $selection" echo "Invalid option selected: $selection"
;; ;;
esac esac
done done
echo "Installation process complete." echo "Installation process complete."