all repos — dotfiles @ b7d960785c9d1035df5eab9921f5a4a3df403282

my *nix dotfiles

ksh/.kshrc.d/99-prompt.ksh (view raw)

 1set -o emacs
 2
 3red="\033[31m"
 4grn="\033[32m"
 5ylw="\033[33m"
 6cyn="\033[36m"
 7blu="\033[34m"
 8prp="\033[35m"
 9bprp="\033[35;1m"
10gry="\033[94m"
11rst="\033[0m"
12
13git_status() {
14    [[ -d "$PWD"/.git ]] && {
15        git_status="$(git status 2> /dev/null)"
16            on_branch=""
17    }
18}
19
20prompt_pwd() {
21    printf '%b' "\001${cyn}\002$(pwd)\001${rst}\002"
22}
23
24rootornot() {
25    [[ "$(id -u)" -eq 0 ]] &&
26        printf '%b' "\001${red}\002#\001${rst}\002"
27}
28
29PS1='\n$(prompt_pwd)\n▲$(rootornot) '
30PS2="> "
31