~mehdix/dotfiles

ref: dbb661005d7e6ccc0e33316323d02d60062be9a0 dotfiles/.local/bin/prompt -rwxr-xr-x 292 bytes
dbb66100Mehdi Sadeghi Change prompt to two lines and add nix. a month ago
                                                                                
1
2
3
4
5
6
7
8
#!/bin/sh
BRANCH=$(git branch --show-current 2>/dev/null)
BRANCH=$(test -n "$BRANCH" && echo "($BRANCH)")
PROMPT="$USER@$(cat /proc/sys/kernel/hostname):$( test "$PWD" = $HOME && echo '~' || echo "$PWD")$BRANCH"
case $(id -u) in
0) echo -e "$PROMPT\\n# " ;;
*) echo -e "$PROMPT\\n$ " ;;
esac