summaryrefslogtreecommitdiff
path: root/.local/bin/prompt
blob: 90e3a173fafd5a2eb62caead1f89db0cfe651bb7 (plain)
1
2
3
4
5
6
7
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