This commit is contained in:
2024-05-24 11:37:47 -05:00
parent b651eb4eb5
commit 550cbbce97
+25 -46
View File
@@ -74,46 +74,30 @@ checkEnv() {
installDepend() { installDepend() {
## Check for dependencies. ## Check for dependencies.
DEPENDENCIES='bash bash-completion tar neovim bat tree multitail' DEPENDENCIES='bash bash-completion tar neovim bat tree multitail fastfetch'
echo -e "${YELLOW}Installing dependencies...${RC}" echo -e "${YELLOW}Installing dependencies...${RC}"
if [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then if [ "$PACKAGER" = "pacman" ]; then
for pkg in $DEPENDENCIES; do if ! command_exists yay && ! command_exists paru; then
read -p "Would you like to install $pkg package? [Y/n]: " choice echo "Installing yay as AUR helper..."
case "$choice" in sudo pacman --noconfirm -S base-devel
y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;; cd /opt && sudo git clone https://aur.archlinux.org/yay-git.git && sudo chown -R "${USER}:${USER}" ./yay-git
n|N) ;; cd yay-git && makepkg --noconfirm -si
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;; else
esac echo "Aur helper already installed"
done fi
elif [ "$PACKAGER" = "yum" ] || [ "$PACKAGER" = "dnf" ]; then if command_exists yay; then
for pkg in $DEPENDENCIES; do AUR_HELPER="yay"
read -p "Would you like to install $pkg package? [Y/n]: " choice elif command_exists paru; then
case "$choice" in AUR_HELPER="paru"
y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;; else
n|N) ;; echo "No AUR helper found. Please install yay or paru."
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;; exit 1
esac fi
done "${AUR_HELPER}" --noconfirm -S ${DEPENDENCIES}
elif [ "$PACKAGER" = "pacman" ]; then elif [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then
for pkg in $DEPENDENCIES; do sudo "$PACKAGER" install -y ${DEPENDENCIES}
read -p "Would you like to install $pkg package? [Y/n]: " choice
case "$choice" in
y|Y|'') sudo "$PACKAGER" -S --noconfirm "$pkg" ;;
n|N) ;;
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" -S --noconfirm "$pkg" ;;
esac
done
elif [ "$PACKAGER" = "zypper" ]; then
for pkg in $DEPENDENCIES; do
read -p "Would you like to install $pkg package? [Y/n]: " choice
case "$choice" in
y|Y|'') sudo "$PACKAGER" install -y "$pkg" ;;
n|N) ;;
*) echo "Invalid choice. Defaulting to yes." && sudo "$PACKAGER" install -y "$pkg" ;;
esac
done
else else
echo "Unsupported package manager: $PACKAGER" sudo "$PACKAGER" install -yq ${DEPENDENCIES}
fi fi
} }
@@ -156,14 +140,9 @@ installFastfetch() {
return return
fi fi
echo -e "${YELLOW}Installing fastfetch...${RC}" if ! curl -sSL https://github.com/fastfetch-cli/fastfetch/releases/download/2.13.2/fastfetch-linux-amd64.deb -o fastfetch-linux-amd64.deb || ! sudo dpkg -i fastfetch-linux-amd64.deb; then
if [ "$PACKAGER" = "nala" ] || [ "$PACKAGER" = "apt" ]; then echo -e "${RED}Something went wrong during fastfetch install${RC}"
if ! curl -sSL https://github.com/fastfetch-cli/fastfetch/releases/download/2.13.2/fastfetch-linux-amd64.deb -o fastfetch-linux-amd64.deb || ! sudo dpkg -i fastfetch-linux-amd64.deb; then exit 1
echo -e "${RED}Something went wrong during fastfetch install${RC}"
exit 1
fi
else
sudo "$PACKAGER" install -y fastfetch
fi fi
} }