Optimize installs and add support for apt powerline

This commit is contained in:
2025-09-17 00:55:47 -07:00
parent 46d487fe32
commit bf7621b151
3 changed files with 20 additions and 9 deletions
+1 -2
View File
@@ -1,4 +1,3 @@
POWERLINE_ROOT=/usr/share/powerline
NO_NEOFETCH=0
NO_NEOFETCH=1
NO_GIT_CHECK=1
NO_ZSH_COWSAY=1
+1 -1
View File
@@ -132,7 +132,7 @@ function set_powerline_zsh_sources {
fi
if [ -d /usr/share/powerline ]; then
# Apt installs here
echo "/usr/share/powerline/bindings/bash/powerline.sh"
POWERLINE_ZSH_SOURCES+="/usr/share/powerline/bindings/bash/powerline.sh"
fi
# If $POWERLINE_ROOT not set or set incorrectly, try default locations
for directory in $PYTHON_ROOTS; do
+18 -6
View File
@@ -302,15 +302,17 @@ function install_aur() {
read response
if [[ $response == 'y' ]] || [[ $response == 'Y' ]]; then
echo "Installing AUR programs from package lists."
to_install=""
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
if [[ "$program" == '#'* || -z "${program// }" ]]; then
continue
fi
if ! program_installed $program; then
yay -Sqa $pacman_args $program
to_install+="$program"
fi
done < <(printf '%s' "$aur")
yay -Sqa $pacman_args "$to_install"
fi
fi
fi
@@ -319,6 +321,7 @@ function install_aur() {
function install_programs() {
if program_installed pacman; then
sudo pacman -Syuq
to_install=""
# https://superuser.com/a/284226
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
@@ -326,31 +329,36 @@ function install_programs() {
continue
fi
if ! program_installed $program; then
sudo pacman -Sq $pacman_args $program
to_install+="$program "
fi
done < <(printf '%s' "$arch")
sudo pacman -Sq $pacman_args "$to_install"
elif program_installed apt-get; then
sudo apt-get update
to_install=""
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
if [[ "$program" == '#'* || -z "${program// }" ]]; then
continue
fi
if ! program_installed $program; then
sudo apt-get install $program
to_install+="$program "
fi
done < <(printf '%s' "$apt")
sudo apt-get install -y $to_install
elif program_installed brew; then
brew update
to_install=""
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
if [[ "$program" == '#'* || -z "${program// }" ]]; then
continue
fi
if ! program_installed $program; then
brew install $program
to_install+="$program "
fi
done < <(printf '%s' "$brew")
brew install $to_install
else
echo "Cannot install programs, no compatible package manager."
fi
@@ -369,25 +377,29 @@ function install_programs() {
fi
if program_installed gem; then
gem update
to_install=""
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
if [[ "$program" == '#'* || -z "${program// }" ]]; then
continue
fi
gem install $program
to_install+="$program "
done < <(printf '%s' "$gem")
gem install $to_install
fi
if program_installed pipx; then
pipx upgrade-all
to_install=""
while IFS= read -r program || [[ -n $program ]]; do
# Check for comment or whitespace
if [[ "$program" == '#'* || -z "${program// }" ]]; then
continue
fi
if ! program_installed $program; then
pipx install $program
to_install+="$program "
fi
done < <(printf '%s' "$pipx")
pipx install $to_install
fi
}