#!/bin/sh
# rasmol.sh
# RasMol Molecular Graphics
# Roger Sayle, August 1995
# Version 2.6
# script modified for linux 
# John Lapeyre
#Wed, 12 Aug 1998 21:34:40 -0700
#
# Example Environment Variables
#

RASMOLPATH=/usr/lib/rasmol
export RASMOLPATH

RASMOL_VISUAL=8

if [ -e /usr/bin/X11/xwininfo ]; then
 RASMOL_VISUAL=`xwininfo -root | perl -ne 'chomp;print if s|\s+Depth:\s+||'` ;
fi

if [ -e "/etc/rasmol/.rasmol.conf" ]; then
   . /etc/rasmol/.rasmol.conf;
fi

if [ -e ~/.rasmol.conf ]; then
   . ~/.rasmol.conf;
fi

case "$1" in 
  -8)
   RASMOL_VISUAL=8
   shift;;
  -16)
   RASMOL_VISUAL=16
   shift;;
  -24)
   RASMOL_VISUAL=32
   shift;;
  -32)
   RASMOL_VISUAL=32
   shift;;
esac
#echo  Using binary rasmol.$RASMOL_VISUAL

if [ $RASMOL_VISUAL = 24 ]; then
  RASMOL_VISUAL=32;
fi

$RASMOLPATH/rasmol.$RASMOL_VISUAL  $*
