You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
815 B

16 years ago
16 years ago
16 years ago
16 years ago
16 years ago
  1. function eliteprompt() {
  2. local NOCOLOR='\[\033[0m\]'
  3. local BLUE='\[\033[1;34m\]'
  4. local CYAN='\[\033[1;36m\]'
  5. local ps1=
  6. local ps1a=
  7. local TTY='$(TTY=`tty` && echo ${TTY:5})'
  8. local TITLEBAR=
  9. case $TERM in
  10. screen|screen-256color|putty|xterm*|rxvt)
  11. TITLEBAR='\[\033]0;\u@\h \w\007\]'
  12. ;;
  13. esac
  14. # timestamp
  15. ps1="$BLUE[$CYAN\\t$BLUE]"
  16. # user/host
  17. ps1a=$NOCOLOR\\u$CYAN\@$NOCOLOR\\h
  18. # workdir and tty
  19. ps1=$ps1' '$BLUE\[$ps1a$CYAN\($NOCOLOR$TTY$CYAN\)$NOCOLOR\\W$BLUE\]
  20. # and the prompt
  21. ps1=$ps1$CYAN\\$
  22. export PS1=$TITLEBAR$ps1$NOCOLOR' '
  23. }
  24. function dummyprompt() {
  25. export PS1='[$( date +%H:%M )] [\u@\h:\w]\$ '
  26. }
  27. function ircprompt() {
  28. export PS1='[$( date +%H:%M )] <$( if [ $UID -eq 0 ]; then echo "@"; fi )\u>'
  29. }
  30. eliteprompt
  31. unset eliteprompt
  32. unset dummyprompt
  33. unset ircprompt