2024-08-02 14:21:24 +00:00
|
|
|
#!{{ lookPath "bash" }}
|
|
|
|
|
|
|
|
# Logging function
|
|
|
|
log() {
|
|
|
|
printf "$(tput setaf 4)$(tput bold)>>>>> %s <<<<<$(tput sgr0)\n" "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
inf() {
|
|
|
|
printf "$(tput setaf 2)╚═══ᐳ $(tput sgr 0 1)$(tput setaf 2)%s$(tput sgr0)\n" "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
err() {
|
|
|
|
printf "$(tput setaf 9)$(tput bold)>>>>> %s ! <<<<<$(tput sgr0)\n" "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Packages to install
|
|
|
|
packages=(
|
|
|
|
bubblewrap
|
|
|
|
curl
|
|
|
|
fzf
|
|
|
|
pass
|
|
|
|
libyaml
|
|
|
|
ranger
|
|
|
|
tmux
|
|
|
|
trash-cli
|
|
|
|
ueberzug
|
|
|
|
unzip
|
|
|
|
wget
|
|
|
|
zip
|
|
|
|
zoxide
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-08-02 21:48:03 +00:00
|
|
|
{{ if ne .chezmoi.username "root" -}}
|
2024-08-02 14:21:24 +00:00
|
|
|
## Update system
|
|
|
|
inf "updating system..."
|
|
|
|
sudo pacman -Syu --noconfirm --quiet
|
|
|
|
|
|
|
|
## Install yay
|
|
|
|
if [ ! $(command -v yay) ]; then
|
|
|
|
inf "installing yay..."
|
|
|
|
sudo pacman -S --needed --noconfirm --quiet git base-devel
|
|
|
|
git clone https://aur.archlinux.org/yay.git /tmp/yay
|
|
|
|
cd /tmp/yay
|
|
|
|
makepkg -si --noconfirm
|
|
|
|
rm -rf /tmp/yay
|
|
|
|
fi
|
|
|
|
|
|
|
|
## Install packages
|
|
|
|
for package in ${packages[@]}; do
|
|
|
|
if [ "$(yay -Qq $package 2> /dev/null)" != $package ]; then
|
|
|
|
inf "installing ${package}..."
|
|
|
|
yay -S --noconfirm --removemake --quiet $package
|
|
|
|
fi
|
|
|
|
done
|
2024-08-02 21:48:03 +00:00
|
|
|
{{ else -}}
|
2024-08-02 14:21:24 +00:00
|
|
|
err "you may not run this script as root"
|
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|