Files
SDG-OS/sdgos/tuis/aur-install.sh
T

29 lines
926 B
Bash
Executable File

#!/bin/bash
# Show a fuzzy-finder TUI for picking new AUR packages to install.
fzf_args=(
--multi
--preview 'clear && yay -Siia {1}'
--preview-label='alt-p: toggle description, alt-b/B: toggle PKGBUILD, alt-j/k: scroll, tab: multi-select'
--preview-label-pos='bottom'
--preview-window 'left:65%:wrap'
--bind 'alt-p:toggle-preview'
--bind 'alt-d:preview-half-page-down,alt-u:preview-half-page-up'
--bind 'alt-k:preview-up,alt-j:preview-down'
--bind 'alt-b:change-preview:clear && yay -Gpa {1} | tail -n +5'
--bind 'alt-B:change-preview:clear && yay -Siia {1}'
--color 'pointer:green,marker:green'
)
pkg_names=$(yay -Slqa | fzf "${fzf_args[@]}")
if [[ -n $pkg_names ]]; then
# Add aur/ prefix to each package name and convert to space-separated for yay
sudo -v
echo "$pkg_names" | sed 's/^/aur\//' | tr '\n' ' ' | xargs yay -S --noconfirm
sudo updatedb
echo "done installing!"
read -n 1
fi