This commit is contained in:
Alvin Vilaythong
2025-11-12 11:23:23 +11:00
parent 3e45cfb170
commit a9e213a1eb
2 changed files with 35 additions and 56 deletions
-42
View File
@@ -1,42 +0,0 @@
# Project Overview
This project consists of a collection of shell scripts designed to automate the installation and configuration of a development environment on Arch Linux-based systems. It uses `pacman` for system packages and `yay` for AUR packages.
The main components are:
- **`install.sh`**: The primary script that runs through the entire installation process.
- **`installbeta.sh`**: A newer, interactive version of the installation script that uses `whiptail` to provide a menu-driven interface.
- **`zsh.sh`**: A script dedicated to setting up Zsh, Oh My Zsh, and several useful plugins.
- **`LazyVim.sh`**: A script for setting up a LazyVim configuration for Neovim.
- **`configs/`**: A directory containing configuration files, including `.zshrc` and lists of packages to be installed (`PackagesPacman.txt`, `PackagesYay.txt`).
# Building and Running
These are shell scripts and do not require a build process. They can be executed directly.
**Running the main installation:**
```bash
./install.sh
```
**Running the interactive installation:**
```bash
./installbeta.sh
```
**Running individual setup scripts:**
```bash
./zsh.sh
./LazyVim.sh
```
# Development Conventions
- The scripts are written in `bash`.
- They are designed to be run on Arch Linux and may have some compatibility with other systems (e.g., `zsh.sh` has checks for `apt`).
- The scripts use `set -eux pipefail` to ensure that they exit on any error and print commands as they are executed, which is good for debugging. This is toggled off for specific commands that might fail without being critical.
- The scripts frequently use `curl` to download other scripts or configuration files from the associated GitHub repository.
- Package lists are maintained in `configs/PackagesPacman.txt` and `configs/PackagesYay.txt`.
- Python dependencies for some tools are listed in `requirements.txt` and installed via `pip`.
+35 -14
View File
@@ -14,11 +14,8 @@ echo '
# Function to display error message
function error_handler() {
echo " "
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "An error occurred. Please check the output above for details."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo " "
set +x
echo -e "An error occurred. Please check the output above for details."
}
# Trap errors
@@ -35,11 +32,11 @@ fi
# Options for the whiptail menu
OPTIONS=(
1 "Run zsh setup script" OFF
1 "Run zsh setup script" ON
2 "Run LazyVim setup script" OFF
3 "Install Docker" OFF
4 "Install Pacman Packages" OFF
5 "Install Yay and AUR Packages" OFF
4 "Install Pacman Packages" ON
5 "Install Yay and AUR Packages" ON
)
CHOICE=$(whiptail --title "Installation Options" --checklist \
@@ -55,7 +52,7 @@ else
fi
# Fail on any command.
set -eux pipefail
set -eu pipefail
# Process selected options
for selection in $CHOICE; do
@@ -81,21 +78,45 @@ for selection in $CHOICE; do
;;
"4")
echo "Installing Pacman Packages..."
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm
if ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesPacman.txt | sudo pacman -S - --needed --noconfirm; then
echo "--------------------------------------------------------------------"
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 "--------------------------------------------------------------------"
fi
;;
"5")
echo "Installing Yay and Yay Packages..."
sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl # These were in the original script before yay install
if ! sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl; then # These were in the original script before yay install
echo "--------------------------------------------------------------------"
echo "Failed to install prerequisite packages for Yay. You can try running it manually:"
echo "sudo pacman -S --needed --noconfirm efibootmgr sbsigntools mokutil sbctl"
echo "--------------------------------------------------------------------"
fi
if ! command -v yay >/dev/null; then
echo "yay is NOT installed. Running installation commands..."
git clone https://aur.archlinux.org/yay.git /tmp/yay_install
(cd /tmp/yay_install && makepkg -si --noconfirm)
if ! git clone https://aur.archlinux.org/yay.git /tmp/yay_install; then
echo "--------------------------------------------------------------------"
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 "--------------------------------------------------------------------"
elif ! (cd /tmp/yay_install && makepkg -si --noconfirm); then
echo "--------------------------------------------------------------------"
echo "Failed to build and install yay. You can try running it manually:"
echo "cd /tmp/yay_install && makepkg -si --noconfirm"
echo "--------------------------------------------------------------------"
fi
rm -rf /tmp/yay_install
else
echo "Yay is already installed."
fi
# Assuming PackagesYay.txt for yay packages, as per common practice
curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean All --answerdiff All - --noconfirm
if ! curl -fsSL https://raw.githubusercontent.com/alvinlollo/Single-install-script/refs/heads/main/configs/PackagesYay.txt | yay -S --needed --save --answerclean All --answerdiff All - --noconfirm; then
echo "--------------------------------------------------------------------"
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 All --answerdiff All - --noconfirm"
echo "--------------------------------------------------------------------"
fi
;;
*)
echo "Invalid option selected: $selection"