FollieHiyuki-dotfiles/home/.local/bin/fzf/fzyay

19 lines
371 B
Plaintext
Raw Normal View History

2021-03-22 18:38:14 -04:00
#!/bin/sh
if [ -z "$1" ]
then
echo "Usage:
-i : install a package
-u : uninstall a package"
else
if [ "$1" = "-i" ]
then
yay -Slq | fzf --multi --preview 'yay -Si {1}' | xargs -ro yay -S
elif [ "$1" = "-u" ]
then
yay -Qq | fzf --multi --preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk "{print \$2}")' | xargs -ro yay -Rns
else
exit 1
fi
fi