home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume39 / elfshell / part01 / .elven / sh / interface
Encoding:
Text File  |  1993-08-29  |  1.8 KB  |  65 lines

  1. #----------------------------------------------------------------------#
  2. #    File:     interface
  3. #    Auth:    Christoph. Alex. North-Keys -- Fri Jan 31 08:32:49 CST 1992
  4. #    Desc:    interface determination, elfshell, bash version
  5. #----------------------------------------------------------------------#
  6. message interface' '
  7.  
  8. if [ ! "$TERM" ] ; then TERM=unknown ; fi   # fall through to case default
  9. case "$TERM" in
  10.     \|*)        # if pipe sign appears, form is `|commands...'
  11.         GURU="`expr "$TERM" : '|\(.*\)'`" ; export GURU
  12.         TERM=guru
  13.         eval "$GURU"
  14.         ;;
  15. esac
  16. bel=""
  17. esc=""
  18. case "$TERM" in
  19.     xterm)
  20.         if [ ! "$XCONSOLE" ] ; then
  21.             title    () { echon "$esc]2;$*$bel" ; }
  22.             label    () { echon "$esc]1;$*$bel" ; }
  23.             icon    () { echon "$esc]I;$*$bel" ; }
  24.             say        () { title $* ; }
  25.             dot        () { title [-${HOSTNICK}- $PWD ] ;
  26.                          label ${HOSTNICK}: `basename $PWD` ; }
  27.         fi
  28.         if [ ! "$DISPLAY" ] ; then DISPLAY=${HOSTNICK}:0 ; export DISPLAY ; fi
  29.         message $DISPLAY' '
  30.         ;;
  31.     sun*)
  32.         if [ "$WINDOW_PARENT" ] ; then
  33.             title    () { echon "$esc]l$*$esc\\" ; }
  34.             label    () { echon "$esc]L$*$esc\\" ; }
  35.             icon    () { echon "$esc]I$*$esc\\" ; }
  36.             say        () { title $* ; }
  37.             dot        () { title [-${HOSTNICK}- $PWD ] ; }
  38.         else
  39.             if [ "`tty`" != "/dev/console" ] ; then
  40.                 TERM="`tset - -I -Q -r -m :\?$TERM`"
  41.             fi
  42.         fi
  43.         ;;
  44.     wy*)
  45.         title    () { echo  "$escF$*\\r\\c" ; }
  46.         say        () { title "$*" ; }
  47.         dot        () { title "`logname` `tty | sed 's@/dev/@@g'` `pwd`" ; }
  48.         ;;
  49.     *)            # default
  50.         say        () { echo $* ; }
  51.         dot        () { echo $PWD ; }
  52.         case "$TERM" in
  53.             emacs)                stty -echo -onlcr nl ;;
  54.             network)            TERM="`tset - -I -Q -r -m :\?xterm`"    ;;
  55.             unknown|dumb|su)    TERM="`tset - -I -Q -r -m :\?vt100`"    ;;
  56.             ?*)                    if [ "$PS1" ]; then message $TERM' ' ; fi    ;;
  57.             *)                    TERM="`tset - -I -Q -r -m :\?vt100`"    ;;
  58.         esac
  59.         ;;
  60. esac
  61.  
  62. export TERM
  63.  
  64. #----eof
  65.