customizing labels for cmdtool icons

Paul V. O'Neill pvo1478 at oce.orst.edu
Sat Feb 11 07:14:11 AEST 1989


This works as part of your .cshrc.  Every remost host that has this in
your .cshrc on that host will label it's icon on your local host's
sunview.  Edit with a textedit tool--other editors will change the
"escape" (^[) to 2 characters (^ and [). (Maybe the mail will change these
escapes to ^ and [, I don't know, they left here as escapes.)

###### stripe stuff 26 dec 88 pvo
# from the 386i's default .cshrc
# 14 jan 89 # stripe only, no cd for rsh, etc.
if  ( $?TERM == 0 ) exit
if ( ( `tty` != /dev/console &&  $term == sun ) || $term == sun-cmd )  then
    set tty="`tty`"
    echo "]L`hostname`\"		#####label the icon####
#   ^^^^^^^^^^^^^^^^^^^^^^^^            ^^^^^^^^^^^^^^^^^^^^^^^
    if ( ! $status ) then
        if ( $tty != /dev/console && $?prompt ) then
            set host=`hostname` user=`whoami`

            if ( $?ISCONSOLE) then
                alias stripe    label 'System Messages for workstation ""$host""'
                unsetenv ISCONSOLE
            else if ( -e /usr/bin/stripe) then
                alias stripe    /usr/bin/stripe
            else
                alias stripe    label 'Commands:  $user @ $host - $cwd'
            endif

	    alias label	'echo -n "]l\!*\"'
            alias cd    'chdir \!*; stripe; echo $cwd'
            alias pushd 'pushd \!*; stripe'
            alias popd  'popd \!*; stripe;echo $cwd'
            alias pwd   'echo $cwd; stripe'
            alias suspend       'suspend; stripe'
            alias su    'setenv IN_SU "$cwd"; /bin/su \!*; stripe; unsetenv IN_SU'
            alias telnet        'telnet \!*; stripe; echo "]L`hostname`\"'
            alias rlogin        'rlogin \!*; stripe; echo "]L`hostname`\"'
            alias rsh        'rsh \!*; stripe; echo "]L`hostname`\"'
            alias on        'on \!*; stripe; echo "]L`hostname`\"'
            alias which 'setenv NO_STRIPE 1; /usr/ucb/which \!*; unsetenv NO_STRIPE'
            if (! $?NO_STRIPE) then
                if ($?IN_SU) then
                    chdir "$IN_SU"; stripe
                else
# bad for escapes from rn, less, fpt                    cd
		stripe
                endif
            endif
        endif
    endif
    unset tty
endif


Paul O'Neill                 pvo at oce.orst.edu
Coastal Imaging Lab
OSU--Oceanography
Corvallis, OR  97331         503-754-3251



More information about the Comp.sys.sun mailing list