dotfiles/modules/01-packages.sh
Martin Büchler 088a46cced refactor(packages): optimize package installation logic to check for existing packages
refactor(shell): enhance TTY keyboard layout setup with existing keymap check
refactor(browsers): improve browser installation script to avoid reinstalling existing packages
refactor(devtools): streamline development tools installation by checking for already installed packages
2025-08-14 22:53:52 +02:00

42 lines
778 B
Bash
Executable File

#!/usr/bin/env bash
# Install paru if not present
if ! command -v paru &>/dev/null; then
echo "paru not found. Installing paru..."
git clone https://aur.archlinux.org/paru.git /tmp/paru
(cd /tmp/paru && makepkg -si --noconfirm)
fi
# List of packages to install (edit as needed)
PACKAGES=(
git
zsh
neovim
tmux
starship
fzf
ripgrep
bat
exa
zsh-autosuggestions
zsh-syntax-highlighting
zsh-completions
btop
pkgfile
inetutils
# Add more packages here
)
to_install=()
for pkg in "${PACKAGES[@]}"; do
if ! paru -Q "$pkg" &>/dev/null; then
to_install+=("$pkg")
fi
done
if [ "${#to_install[@]}" -gt 0 ]; then
paru -S --noconfirm "${to_install[@]}"
else
echo "All packages already installed."
fi