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.

46 lines
862 B

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. putty|xterm*|rxvt)
  11. TITLEBAR='\[\033]0;\u@\h ('$TTY') \w\007\]' ;;
  12. *)
  13. TITLEBAR='' ;;
  14. esac
  15. # timestamp
  16. ps1a='$( date +%H:%M )'
  17. ps1=$ps1$BLUE'['$CYAN$ps1a$BLUE']'
  18. # user/host
  19. ps1a=$NOCOLOR\\u$CYAN\@$NOCOLOR\\h
  20. # workdir and tty
  21. ps1=$ps1' '$BLUE\[$ps1a$CYAN\($NOCOLOR$TTY$CYAN\)$NOCOLOR\\W$BLUE\]
  22. # and the prompt
  23. ps1=$ps1$CYAN\\$
  24. export PS1=$TITLEBAR$ps1$NOCOLOR' '
  25. }
  26. function dummyprompt() {
  27. export PS1='[$( date +%H:%M )] [\u@\h:\w]\$ '
  28. }
  29. function ircprompt() {
  30. export PS1='[$( date +%H:%M )] <$( if [ $UID -eq 0 ]; then echo "@"; fi )\u>'
  31. }
  32. eliteprompt
  33. unset eliteprompt
  34. unset dummyprompt
  35. unset ircprompt