function eliteprompt() {
|
|
local NOCOLOR='\[\033[0m\]'
|
|
local BLUE='\[\033[1;34m\]'
|
|
local CYAN='\[\033[1;36m\]'
|
|
|
|
local ps1=''
|
|
local ps1a=''
|
|
|
|
local TTY='$( TTY=`tty` && echo ${TTY:5} )'
|
|
local TITLEBAR=''
|
|
|
|
case $TERM in
|
|
putty|xterm*|rxvt)
|
|
TITLEBAR='\[\033]0;\u@\h ('$TTY') \w\007\]' ;;
|
|
*)
|
|
TITLEBAR='' ;;
|
|
esac
|
|
|
|
# timestamp
|
|
ps1a='$( date +%H:%M )'
|
|
ps1=$ps1$BLUE'['$CYAN$ps1a$BLUE']'
|
|
|
|
# user/host
|
|
ps1a=$NOCOLOR\\u$CYAN\@$NOCOLOR\\h
|
|
|
|
# workdir and tty
|
|
ps1=$ps1' '$BLUE\[$ps1a$CYAN\($NOCOLOR$TTY$CYAN\)$NOCOLOR\\W$BLUE\]
|
|
|
|
# and the prompt
|
|
ps1=$ps1$CYAN\\$
|
|
export PS1=$TITLEBAR$ps1$NOCOLOR' '
|
|
}
|
|
|
|
function dummyprompt() {
|
|
export PS1='[$( date +%H:%M )] [\u@\h:\w]\$ '
|
|
}
|
|
|
|
function ircprompt() {
|
|
export PS1='[$( date +%H:%M )] <$( if [ $UID -eq 0 ]; then echo "@"; fi )\u>'
|
|
}
|
|
|
|
eliteprompt
|
|
|
|
unset eliteprompt
|
|
unset dummyprompt
|
|
unset ircprompt
|