#!/bin/sh # # last update: 060203 # # author: Slaton Lipscomb # # purpose: Set the proper colormode and start web. # # details: Uses the SPRGB_DIR environment variable (which is required by # Web) to get the correct path. SPRGB_DIR is supposed to end in a # trailing slash (/) but this is commonly forgotten, so we deal # with that situation. # # For simplicity's sake I may change the script to merely assume # that the Web_resources_linux24 file is in the same directory # as this script. This seems reasonable since the web/bin # directory is supposed to be in the user's executable path if # SPIDER/Web is properly configured. # # history: 060203 - updated to reflect SPIDER 13.00's preference of # putting Web binaries in web/bin instead of web/src. # # 040901 - updated to reflect name change of Web executable to # web_linux_24. # # 030115 - updated to change the root window's VisualClass back # to the previous setting (xrdb -remove) after exiting Web. # ## Usage: ## ## $ web [args] if [ -e "$SPRGB_DIR" ]; then WEB_SRC=`echo $SPRGB_DIR | awk '{sub(/rgb/, "src"); print $0}'` WEB_BIN=`echo $SPRGB_DIR | awk '{sub(/rgb/, "bin"); print $0}'` echo $SPRGB_DIR | grep "/$" > /dev/null if [ "$?" -ne "0" ]; then WEB_SRC="$WEB_SRC/" fi else echo "ERROR: SPIDER environment is not properly set up:" echo "The SPRGB_DIR variable must be set." exit 1 fi if [ -f $WEB_SRC/Web_resources_linux24 ]; then xrdb -load $WEB_SRC/Web_resources_linux24 else echo "ERROR: Web_resources_linux24 file not found in $WEB_SRC" exit 1 fi if [ -f $WEB_BIN/web_linux_24 ]; then $WEB_BIN/web_linux_24 $* xrdb -remove exit 0 else echo "ERROR: web_linux_24 executable not found in $WEB_BIN" echo "If this file was renamed, please change it back!" xrdb -remove exit 1 fi