# /site/etc/csh.login by jhs@ # copied to # ~/public_html/src/bsd/fixes/freebsd/src/jhs/etc # by # cd /site/etc ; make ; make install # # Invoked (on FreeBSD-3.2) after /etc/csh.cshrc # setenv ENABLE_STARTUP_LOCALE # 8-bit locale, See also rc and profile # setenv LANG de_DE.ISO_8859-1 # In FreeBSD, sets date in German language # Do not set LANG for SCO as it's incompatible # SCO_SV offers in /etc/default/lang a variety of alternates for LANG= # C_C.C english_us.ascii en_US.ascii german_germany.8859 # english_uk.8859 english_us.8859 de_DE.ISO8859-1 # en_GB.ISO8859-1 en_US.ISO8859-1 # setenv MM_CHARSET ISO-8859-1 # locales list in /usr/share/locale/* set HOSTNAME = `uname -n` # hostname -s cannot be used: # zombie & hobel don't allow any parameter to hostname, # thus `hostname -s` attempts (& fails) to set HOSTNAME to `-s` # FreeBSD allows `hostname -s` set JSDOM = "js.berklix.net" # switch ($DOMAIN) #{ # case $JSDOM: #{ # if ( `tty` == /dev/ttyv0 ) then # true # # suggest xinit -auth .Xauthority # else # # echo "csh.login: Not starting X Windows, as not on ttyv0." # endif # breaksw #} # endsw #} # Notes On DISPLAY Environment Variable: # - Testing if DISPLAY is set is the only method I (jhs) know to determine # if you are running within a X Display. # - If you are running within an X Display, xinit or xdm # will have set DISPLAY for you. # - If you invoke 'xhost +' from a host not running an X Server, the xhost # waits until time-out for each host, delaying login, # (Though I now use xauth rather than the simpler xhost). # - Running 'xhost +' (or xauth) from within every fresh csh would be a waste, # so just do it at login. # - So do Not set DISPLAY in /etc/csh.cshrc, as we need # to inspect it, to know if it is appropriate to call 'xhost +' ; # - Once the decision whether or not to call 'xhost +' or xauth is made, we can # then set DISPLAY to something [else] if desired. # - Any interactive 'setenv DISPLAY' is inherited by subsequent child cshells. # - It's often desirable to set DISPLAY to point at my usual screen (flip:0), # but sometimes I run an xinit locally on another host, & then it's sometimes # not appropriate. # - Not all logins run inside local xdm xterms, some may run in local # 24x80 screens, prior to an xinit, & some may be rlogins to other hosts. if ($?DISPLAY == 0) then #{ # echo "csh.login: DISPLAY unset on $HOSTNAME, so not doing xhost +" # The echo must be commented out normally, else it breaks rsh/rdist, # just use it for debugging, when run in non X-Windows mode, to ensure # that when we rlogin to another host not running X, we wont hang on # the xhost+ command. else #}{ # This might hopefully get run if using xdm, but is not run if using # a manual xinit, as by time of xinit, login has finished. # so need to move this bit to .xinitrc or .xsession etc. if ($DISPLAY == :0.0) then #{ switch ($DOMAIN) #{ case $JSDOM: #{ case mo.berklix.net: foreach i ( dual fire flip king lapa \ lapa.jhs-plip.private lapd lapl \ laps lapo blak mart mini park rain \ scan wind ) #{ ( xauth extract - ${HOSTNAME}:0 | \ rsh $i xauth merge - & \ ) >& /dev/null # Backgrounded to avoid errors as some # hosts not unreachable. end #} breaksw #} case mmc.private: #{ breaksw #} case otn.lm.dasa.de: #{ set DASA_DOMAIN = otn.lm.dasa.de ( xhost \ +stacey-pc.${DASA_DOMAIN} \ +stacey-xt.${DASA_DOMAIN} \ +caeh21.${DASA_DOMAIN} \ >& /dev/null ) > /dev/null xlbiff & # Live net, so display incoming mail. breaksw #} endsw #} endif #} endif #} # A note on xhost & xauth: # xhost: good enough for gv etc, but although it lets exmh # from a remote host start, exmh cannot open sub windows. # xauth: allows things (EG exmh sub windows) that require better # security to work OK. # It is not necessary to ensure that DISPLAY variable on # host_running_exmh is a text string matching the name shown # by `xauth list` on display host, a numeric IP equivalent is # acceptable (I use numeric IPs EG 192.168.91.24:0 to avoid a # netscape named problem). # cwt012:0.0 Dasa VT1300 colour X - To change DISPLAY Use logindetail # caeh32:0.0 Dasa Remi console if ($?DISPLAY == 0) then #{ Allow for probable remote operation # setenv DISPLAY for X tools such as exmh, that are started on gate:, # within an xterm started from flip: as `xterm -e rlogin gate`. switch ($DOMAIN) #{ case $JSDOM: #{ case mo.berklix.net: # if ( ($HOSTNAME == flip) || \ # ($HOSTNAME == fire) || \ # ($HOSTNAME == laps) || \ # ($HOSTNAME == lapo) || \ # ($HOSTNAME == lapa) || \ # ($HOSTNAME == lapl) || \ # ($HOSTNAME == lapd)) then #{ # # Avoid setting DISPLAY, as we may # # still want to manually launch an xinit, # # and let it set DISPLAY :0.0 # else #}{ # # I used to use a Numeric DISPLAY rather than # # alphabetic to allow for Netscape. # # I guess Netscape ignored the resolver lib # # & insisted on using bind, & as I didnt # # used to run a named it ignored /etc/hosts # # & couldnt resolve flip to 192.168.91.24 # # setenv DISPLAY 192.168.91.24:0 # # echo "Not appropriate when working on ncd19:0" # if ( X.`whoami` == X.jhs) then #{ # setenv DISPLAY disp:0 # else # }{ # setenv DISPLAY lapa:0 # # Guest terminal EG mk@ etc. # endif #} # endif #} # --------------- OLD ABOVE ---------- # The logic below has not yet been considered # for NCD Xterminal. # I suspect variables HOSTDISPLAY & REMOTEHOST # might be unique to tcsh & not csh, so keep logic # above for copying for use on older non FreeBSD sites. if ( ${?HOSTDISPLAY} ) then # Screen on local PC, typically: # HOSTDISPLAY=laps.$JSDOM:0.0 # No action needed. else # Screen is a remote PC, typically: # REMOTEHOST=laps.$JSDOM setenv DISPLAY `printenv REMOTEHOST`:0 endif #} breaksw #} case default: #{ # echo "If off site, consider setenv DISPLAY something:0.0" breaksw #} endsw #} # xrdb -merge ~/.Xdefaults.common # the above xrdb gets run each time # on flip, I use fvwm to do an rlogin to gate, # that's too often ! # it also fails on an `rlogin lapt` so hashed out endif #} # holz common things switch ($DOMAIN) #{ case $JSDOM: #{ case mo.berklix.net: case otn.lm.dasa.de: endsw #} # Individual host things switch ($HOSTNAME) #{ case desk: #{ # echo "Starting istec." ; istec & breaksw #} case surf: #{ stty cs8 echo "You may want to do one of" echo " stty rows 24 ; setenv LINES 24" echo " stty rows 56 ; setenv LINES 56" echo "or if host has bin/X11:" echo ' eval `resize`' breaksw #} case freefall: case thud: case pcsbst: mesg y # network systems, people may need to contact me msgs -f # Read system messages breaksw #} case default: #{ # echo ".login has no special knowledge of this host" breaksw #} endsw #} setenv BLOCKSIZE K # as per 4.2 default # Unset all my internal stuff, appropriate only to this file. unset HOSTNAME unset DASA_DOMAIN setenv ORGANIZATION $HOME/.organization # For use by gnats # perhaps an init domain steered personal thing # EG to remove proxy @ bsn.com from .netscape/preferences.js