updated updater
This commit is contained in:
parent
24b86bb679
commit
1012970b6b
15
fpf
15
fpf
|
@ -155,10 +155,9 @@ 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='>>' \
|
||||||
|
@ -171,10 +170,14 @@ Update() {
|
||||||
--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
|
--bind ctrl-n:next-selected,ctrl-b:prev-selected < "/tmp/fpf-updates" > /dev/null
|
||||||
[[ "$(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
|
||||||
|
|
Loading…
Reference in New Issue