This commit is contained in:
Eric Lay 2020-06-28 10:36:03 -05:00
parent 564a7b4c7f
commit c8c65bf7c2
3 changed files with 13 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# Maintainer: Eric Lay <ericlaytm@gmail.com>
pkgname=fuzzy-pkg-finder
pkgver=0.9
pkgver=0.9.1
pkgrel=1
pkgdesc="Simple cli command for using fzf to search and install packages"
arch=('x86_64' 'aarch64')

View File

@ -16,7 +16,7 @@ makepkg -sric
\
Usage:
```
Syntax: fpf -[a|l|la|R|Ra|h]
Syntax: fpf -[a|l|la|R|o|h]
Defaults to Pacman if no options passed
options:
@ -24,5 +24,6 @@ a Search/List and install from AUR with Yay
l Search/List installed packages from official repo
la Search/List installed packages from AUR
R Search/List installed packages from official repos for removal
o Search/List orphaned packages for removal
h Print this help screen.
```

16
fpf
View File

@ -6,7 +6,7 @@ Help() {
echo "Use fzf to search and install with Pacman and Yay"
echo "Defaults to Pacman if no options passed"
echo
echo "Syntax: fpf -[a|l|la|R|h]"
echo "Syntax: fpf -[a|l|la|R|o|h]"
echo
echo "options:"
echo
@ -18,6 +18,8 @@ Help() {
echo
echo "R Search/List installed packages for removal"
echo
echo "o Search/List orphaned packages for removal"
echo
echo "h Print this help screen."
echo
}
@ -72,9 +74,11 @@ AurInstalled() {
}
### ORPHANS
#Orphans() {
#}
Orphans() {
sort <(pacman -Qtdq) > /tmp/orphaned
echo "$(echo -e ' Select packages to remove\n (use TAB to toggle selection)'; cat /tmp/orphaned)" > /tmp/orphaned
cat /tmp/orphaned |fzf -q "$1" -e -m --preview 'cat <(pacman -Si {1} 2>/dev/null || yay -Qi {1}) <(pacman -Ql {1} | awk "{print \$2}")' --preview-window=65%:wrap --layout=reverse --marker='>>' --header-lines=2 --info=hidden --ansi --margin="2%,1%,2%,1%" --cycle | xargs -ro sudo pacman -Rsn
}
### MAIN
@ -102,10 +106,10 @@ else
-R|--remove)
Remove "$2"
;;
-h|--help) #Usage // Help
-h|--help)
Help
;;
-*) #Error catching
-*)
echo "Invalid Usage"
Help
;;