bash: added xb function

xbps can get really long in commands
This commit is contained in:
Vitor Gonçalves 2023-12-05 01:04:20 -03:00
parent b369d83135
commit b3cf484581
Signed by: vitorg
GPG Key ID: B90BF113DF56EB41
1 changed files with 33 additions and 0 deletions

View File

@ -11,3 +11,36 @@ wbp() {
"$EDITOR" "$path"
printf "Your blogpost is saved at %s\n" "$path"
}
xb() {
# function for handling xbps in a nicer way
case $1 in
install | i)
sudo xbps-install ${@:2}
;;
remove | r)
sudo xbps-remove -R ${@:2}
;;
query | q)
xbps-query ${@:2}
;;
search | s)
xbps-query -Rs ${@:2}
;;
upgrade | u)
sudo xbps-install -Su
;;
locate | l)
xlocate ${@:2}
;;
*)
printf "Usage:\n"
printf "xb i: xbps-install\n"
printf "xb r: xbps-remove -R\n"
printf "xb q: xbps-query\n"
printf "xb s: xbps-query -Rs\n"
printf "xb u: xbps-install -Su\n"
printf "xb l: xlocate\n"
;;
esac
}