config/shell/arch: automatically clean up upon package removal

This commit is contained in:
xeruf 2021-06-18 18:05:51 +02:00
parent 90a1e8f906
commit 63c7a24788
1 changed files with 3 additions and 3 deletions

View File

@ -5,9 +5,9 @@ alias dragon='dragon-drag-and-drop'
# Arch aliases # Arch aliases
alias pac='noglob sudo pacman' alias pac='noglob sudo pacman'
alias pacs='pac -Syu --needed' alias pacs='pac -Syu --needed'
alias pacr='pac -R' alias pacr='pac -R --recursive'
alias yays='noglob yay -Sy --needed' alias yays='noglob yay -Sy --needed'
alias yayr='noglob yay -R' alias yayr='noglob yay -R --cascade --recursive'
yzf() { yzf() {
pos=$1 pos=$1
@ -38,7 +38,7 @@ yar() {
pkg=$(yay --color=always -Q "$@" | yzf 1 --preview="yay --color always -Qli {1}") pkg=$(yay --color=always -Q "$@" | yzf 1 --preview="yay --color always -Qli {1}")
if test -n "$pkg" if test -n "$pkg"
then echo "Removing $pkg..." then echo "Removing $pkg..."
cmd="yay -R $pkg" cmd="yay -R --cascade --recursive $pkg"
print -s "$cmd" print -s "$cmd"
eval "$cmd" eval "$cmd"
fi fi