From a6cae126b633ffded535593484e185ab5520e59e Mon Sep 17 00:00:00 2001 From: Vitor Gonçalves Date: Sat, 20 Jan 2024 02:47:21 -0300 Subject: added p() and ap() to bash p=pacman ap=aur pacman (i'm using aurutils, i need this) --- .config/bash/functions | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) 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 +} -- cgit 1.4.1-2-gfad0