about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.config/bash/functions52
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
+}