summaryrefslogtreecommitdiff
path: root/.local/bin
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/prompt8
1 files changed, 8 insertions, 0 deletions
diff --git a/.local/bin/prompt b/.local/bin/prompt
new file mode 100755
index 0000000..90e3a17
--- /dev/null
+++ b/.local/bin/prompt
@@ -0,0 +1,8 @@
+#!/bin/sh
+BRANCH=$(git branch --show-current 2>/dev/null)
+BRANCH=$(test -d .git && test -n $BRANCH && echo "($BRANCH)")
+PROMPT="[$(hostname):$(basename "$PWD")$BRANCH]"
+case $(id -u) in
+0) echo "$PROMPT# " ;;
+*) echo "$PROMPT$ " ;;
+esac