diff options
| author | Mehdi Sadeghi <mehdi@mehdix.org> | 2021-05-16 20:39:05 +0200 |
|---|---|---|
| committer | Mehdi Sadeghi <mehdi@mehdix.org> | 2021-05-16 20:39:39 +0200 |
| commit | eb1dbbb8be24a284777dc341c59841051e68045a (patch) | |
| tree | b5ffb2d9226c2a5b7e9b5a92b77bff0c7eb99919 /.local/bin/prompt | |
| parent | ca0f4b3eb74c4c632f1d547f46be5b6a57999dc0 (diff) | |
Add basic (posix) shell.
Diffstat (limited to '.local/bin/prompt')
| -rwxr-xr-x | .local/bin/prompt | 8 |
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 |
