From c8c65bf7c21fcb53d4ff025e8c98f1b8494eee3f Mon Sep 17 00:00:00 2001 From: Eric Lay Date: Sun, 28 Jun 2020 10:36:03 -0500 Subject: [PATCH] v0.9.1 --- PKGBUILD | 2 +- README.md | 3 ++- fpf | 16 ++++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/PKGBUILD b/PKGBUILD index 715e0d8..435c5b7 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Eric Lay 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') diff --git a/README.md b/README.md index baabb4a..e9c9399 100644 --- a/README.md +++ b/README.md @@ -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. ``` diff --git a/fpf b/fpf index 9956038..840969a 100644 --- a/fpf +++ b/fpf @@ -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 ;;