Simplify the fzf script for yay

This commit is contained in:
FollieHiyuki 2021-03-23 01:38:14 +03:00
parent 9a3dae27c5
commit 1ba97b4a54
No known key found for this signature in database
GPG Key ID: 813CF484F4993419
4 changed files with 22 additions and 6 deletions

View File

@ -1,3 +0,0 @@
#!/bin/sh
yay -Slq | fzf --multi --preview 'yay -Si {1}' | xargs -ro yay -S

View File

@ -1,3 +0,0 @@
#!/bin/sh
yay -Qq | fzf --multi --preview 'cat <(yay -Si {1}) <(yay -Fl {1} | awk "{print \$2}")' | xargs -ro yay -Rns

4
home/.local/bin/fzf/fzxbps Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
# Query installed packages. For installing one use `fuzzypkg`
xbps-query -s "*" | awk '{print $2}' | fzf --multi --preview 'xbps-query -S {}'

18
home/.local/bin/fzf/fzyay Executable file
View File

@ -0,0 +1,18 @@
#!/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