summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2021-11-02 14:11:36 +0100
committerxengineering <me@xengineering.eu>2021-11-02 14:11:36 +0100
commit516ca143aa9ce169613442dbf1a88b957a683e5f (patch)
treed994abd9fa873684598f67344770c6273fa977af
parent9da7f7a5acd7423a28f4c8e8175c4d141f659180 (diff)
downloaddotfiles-516ca143aa9ce169613442dbf1a88b957a683e5f.tar
dotfiles-516ca143aa9ce169613442dbf1a88b957a683e5f.tar.zst
dotfiles-516ca143aa9ce169613442dbf1a88b957a683e5f.zip
Add rand_util() Function to .bashrc
-rw-r--r--.bashrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index b246209..01e951e 100644
--- a/.bashrc
+++ b/.bashrc
@@ -44,6 +44,12 @@ get_nonzero_retcode() {
fi
}
+# select a random binary from the corutils package and open the manual for it
+# works only on Arch Linux
+rand_util() {
+ pacman -Ql coreutils | grep bin | awk '{print $2}' | sed '/^.*\/$/d' | shuf -n 1 - | xargs man
+}
+
PS1='[\e[31m$(get_nonzero_retcode)\e[0m\e[32;1m$(date +"%H:%M:%S")\e[0m \e[35;1m\u@\h\e[0m\e[33;1m$(parse_git_branch)\e[0m \e[36;1m\W\e[0m]
$ '