updated updater

This commit is contained in:
Eric Lay 2023-11-20 21:50:24 -06:00
parent 24b86bb679
commit 1012970b6b
1 changed files with 23 additions and 20 deletions

43
fpf
View File

@ -155,26 +155,29 @@ Remove() {
} }
# Update installed pkgs # Update installed pkgs
Update() { Update() (
checkupdates | viewUpdates() {
fzf -q -e -m \ fzf --preview='cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' \
--preview='cat <(pacman -Si {1}) <(pacman -Fl {1} | awk "{print \$2}")' \ --preview-window=65%:wrap \
--preview-window=65%:wrap \ --layout=reverse \
--layout=reverse \ --marker='>>' \
--marker='>>' \ --header="$(echo -e '\nPackages with updates available:\n\n')" \
--header="$(echo -e '\nPackages with updates available:\n\n')" \ --info=hidden \
--info=hidden \ --ansi \
--ansi \ --margin="2%,1%,2%,1%" \
--margin="2%,1%,2%,1%" \ --cycle \
--cycle \ --bind 'focus:transform-preview-label:echo ⌇ https://gitlab.archlinux.org/archlinux/packaging/packages/{1}/-/commits/main ⌇' \
--bind 'focus:transform-preview-label:echo ⌇ https://gitlab.archlinux.org/archlinux/packaging/packages/{1}/-/commits/main ⌇' \ --bind=ctrl-k:preview:"cat /tmp/fpf-kbinds" \
--bind=ctrl-k:preview:"cat /tmp/fpf-kbinds" \ --bind=ctrl-h:preview:"cat /tmp/fpf-help" \
--bind=ctrl-h:preview:"cat /tmp/fpf-help" \ --bind 'ctrl-/:change-preview-window(hidden|)' \
--bind 'ctrl-/:change-preview-window(hidden|)' \ --bind ctrl-n:next-selected,ctrl-b:prev-selected < "/tmp/fpf-updates" > /dev/null
--bind ctrl-n:next-selected,ctrl-b:prev-selected [[ "$(printf '\nWould you like to update? [y/N]> ' >&2; read; echo $REPLY)" == [Nn]* ]] \
[[ "$(printf '\nWould you like to update? [y/N]> ' >&2; read; echo $REPLY)" == [Nn]* ]] \ && printf "\nPlease update soon :(\n" || sudo pacman -Syu
&& printf "\nPlease update soon\n" || sudo pacman -Syu }
} checkupdates > "/tmp/fpf-updates"
[ -s "/tmp/fpf-updates" ] && viewUpdates ||
printf "\nThere are no available updates :)\n"
)
### AUR ### AUR
# Get AUR package database, remove unwanted lines, sort, mark installed, preview infos and finally hand off to yay for install # Get AUR package database, remove unwanted lines, sort, mark installed, preview infos and finally hand off to yay for install