added p() and ap() to bash

p=pacman
ap=aur pacman (i'm using aurutils, i need this)
This commit is contained in:
Vitor Gonçalves 2024-01-20 02:47:21 -03:00
parent 82c9470ee3
commit a6cae126b6
Signed by: vitorg
GPG Key ID: B90BF113DF56EB41
1 changed files with 52 additions and 0 deletions

View File

@ -38,3 +38,55 @@ xb() {
;;
esac
}
p() {
# function for handling pacman in a nicer way too
case $1 in
install | i)
sudo pacman -S "${@:2}"
;;
remove | r)
sudo pacman -Rns "${@:2}"
;;
query | q)
pacman -Q "${@:2}"
;;
search | s)
pacman -Ss "${@:2}"
;;
upgrade | u)
sudo pacman -Syu
;;
locate | l)
pacman -F "${@:2}"
;;
*)
printf "Usage:\n"
printf "p i: pacman -S\n"
printf "p r: pacman -Rns\n"
printf "p q: pacman -Qs\n"
printf "p s: pacman -Ss\n"
printf "p u: pacman -Syu\n"
printf "p l: pacman -F\n"
;;
esac
}
ap() {
# function to make aurutils a bit more friendly
case $1 in
i)
aur sync ${@:2}
sudo pacman -S ${@:2}
;;
u)
aur sync -u
sudo pacman -Syu
;;
*)
printf "Usage:\n"
printf "ap i: aur sync && pacman -S\n"
printf "ap u: aur sync -u && pacman -Syu\n"
;;
esac
}