about summary refs log tree commit diff stats
path: root/.config
diff options
context:
space:
mode:
authorVitor Gonçalves <vitorg@tilde.team>2023-12-05 01:04:20 -0300
committerVitor Gonçalves <vitorg@tilde.team>2023-12-05 01:04:20 -0300
commitb3cf484581ba19b07adc344431b62b3ddde74409 (patch)
treeed85414457f41d8c7ee1a6c31d8db1fe7c1300cb /.config
parentb369d831351907a72c298222e3957c0fe7a0e498 (diff)
downloaddots-b3cf484581ba19b07adc344431b62b3ddde74409.tar.gz
bash: added xb function
xbps can get really long in commands
Diffstat (limited to '.config')
-rw-r--r--.config/bash/functions33
1 files changed, 33 insertions, 0 deletions
diff --git a/.config/bash/functions b/.config/bash/functions
index 2835c92..83c6fe8 100644
--- a/.config/bash/functions
+++ b/.config/bash/functions
@@ -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
+}