diff options
author | Vitor Gonçalves <vitorg@tilde.team> | 2024-01-20 02:47:21 -0300 |
---|---|---|
committer | Vitor Gonçalves <vitorg@tilde.team> | 2024-01-20 02:47:21 -0300 |
commit | a6cae126b633ffded535593484e185ab5520e59e (patch) | |
tree | 4b41146e5f2e68b414071bd02b5816916bd07ccd | |
parent | 82c9470ee3ea3971c9f03a7475481118d1b9a800 (diff) | |
download | dots-a6cae126b633ffded535593484e185ab5520e59e.tar.gz |
added p() and ap() to bash
p=pacman ap=aur pacman (i'm using aurutils, i need this)
-rw-r--r-- | .config/bash/functions | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/.config/bash/functions b/.config/bash/functions index 14309b9..c2bfff2 100644 --- a/.config/bash/functions +++ b/.config/bash/functions @@ -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 +} |