all repos — dotfiles @ 7aea05e57ad97627f5907f1e8e220b61cc467254

my *nix dotfiles

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

 1set -o emacs
 2lf='
 3'
 4cr=$(print -n '\r')
 5esc=$(print -n '\033')
 6ps1flag=$(print -n '\001')
 7
 8red="$esc[31m"
 9grn="$esc[32m"
10ylw="$esc[33m"
11cyn="$esc[36m"
12blu="$esc[34m"
13prp="$esc[35m"
14bprp="$esc[35;1m"
15gry="$esc[94m"
16rst="$esc[0m"
17
18git_status() {
19	if [[ -d .git ]]; then
20		git_status=$(git status 2>/dev/null)
21		on_branch=
22	fi
23}
24
25# first, set the rootornot part
26if [[ $(id -u) = 0 ]]; then
27	PS1="$ps1flag$red$ps1flag#$ps1flag$rst$ps1flag"
28else
29	PS1=
30fi
31
32# then, combine it all
33PS1="$ps1flag$cr
34$ps1flag$cyn$ps1flag\$PWD$ps1flag$rst$ps1flag
35$PS1 "
36PS2="> "