summaryrefslogtreecommitdiff
path: root/biology/rasmol/files
diff options
context:
space:
mode:
authorAnton Berezin <tobez@FreeBSD.org>2001-09-06 21:25:13 +0000
committerAnton Berezin <tobez@FreeBSD.org>2001-09-06 21:25:13 +0000
commitfc3d9f848215142c094f1c3cac9fa96740f4ce02 (patch)
tree4abba9be2640801108503d16757a7526f2868ed9 /biology/rasmol/files
parentUpdate to 0.5.11. (diff)
Make biology/rasmol work at all color depths.
PR: 30406 Submitted by: Glenn Johnson <gjohnson@srrc.ars.usda.gov>
Diffstat (limited to 'biology/rasmol/files')
-rw-r--r--biology/rasmol/files/rasmol21
1 files changed, 21 insertions, 0 deletions
diff --git a/biology/rasmol/files/rasmol b/biology/rasmol/files/rasmol
new file mode 100644
index 000000000000..6a0531e1bda5
--- /dev/null
+++ b/biology/rasmol/files/rasmol
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# Determine if X is running
+if [ -z $DISPLAY ]; then
+ echo You must be running X for this.
+else
+# Try to determine the color depth of the X server
+
+ DEPTH=`xwininfo -root | grep Depth | awk '{print $2}'`
+
+ if [ $DEPTH = 24 -o $DEPTH = 32 ]; then
+ PROGRAM=rasmol-32
+ elif [ $DEPTH = 16 ]; then
+ PROGRAM=rasmol-16
+ elif [ $DEPTH = 8 ]; then
+ PROGRAM=rasmol-8
+ else
+ echo Can not determine color depth of Display $DISPLAY
+ fi
+ exec $PROGRAM $@
+fi