#!/bin/csh

set colordepth = \
`xdpyinfo | grep depths | cut -c 18- | sed 's/,//g' | sed 's/[0-9]* //g'`
if ("$colordepth" == '8') then 
 set colordepth = 8
else if ("$colordepth" == '16') then
 set colordepth = 16
else if ("$colordepth" == '24') then
 set colordepth = 32
else if ("$colordepth" == '32') then
 set colordepth = 32
else
 set colordepth = 8
endif

set PROG = rasmol.$colordepth
setenv RASMOLPATH /asm/home/Moon/Rasmol/Doc/
setenv RASMOLPDBPATH /asm/home/Moon/Rasmol/Data/

where rasmol.$colordepth | grep ${hosttype}Bin > /dev/null
if ($status == 1) then
 attach -n -t nfs -e asm:/home
 set path = ( /asm/home/Moon/Bin /asm/home/Moon/Bin/${hosttype}Bin $path )
 rehash
endif

if ($# == 0) then
 foreach file ( \
  /asm/home/Moon/Rasmol/Data/1D66.pdb \
  /asm/home/Moon/Rasmol/Data/Nanotube8x3x3x3x1.pdb \
  /asm/home/Moon/Rasmol/Data/Si_screw_dipole.pdb \
 )
  if (-e $file) then
   xterm -geometry 80x25 -bg gray40 -fg white -cr yellow -fn 7x13 \
    -sb -e /asm/home/Moon/Bin/${hosttype}Bin/$PROG $file
  endif
 end
else
 xterm -geometry 80x25 -bg gray40 -fg white -cr yellow -fn 7x13 \
  -sb -e /asm/home/Moon/Bin/${hosttype}Bin/$PROG $*
endif
