#!/bin/bash #--------------------------------------------------------------------- # File information. # File: wolf4sdl.wrapper.in # Purpose: Single-instance wrapper (Laclin-specific) # License: BSD-style (for this file only) # Revision: 260503 #--------------------------------------------------------------------- # Wrapper parameters. BASEDIR=$PRODTREE/wolf4sdl XBINDIR=$BASEDIR/program TARGET=$XBINDIR/wolf4sdl LIBDIR=$BASEDIR/lib PROGNAME="wolf4sdl" SNDFLAG=false export BROWSER=`which minibrowser` NN=`getx11dim 2>&1 | sed -e 's/x.*//' | grep '^[0-9][0-9]*'` if [ "@$NN" == "@" ]; then exit 1; fi NN=`calc "int ($NN / 320) - 1"` if [ "$NN" -lt "1" ]; then exit 1; fi WID=`calc "$NN * 320"` HGT=`calc "$NN * 200"` #--------------------------------------------------------------------- # Run the target if it's available. if [ -f $TARGET ]; then # If there are no parameters, start in # user's home directory if [ "x$1" = "x" ]; then cd; fi cd $XBINDIR # Required for this program if [ "@$SNDFLAG" == "@true" ]; then resetpcmvol # Adjust volume fi if [ -d $LIBDIR ]; then # Adjust LD_LIBRARY_PATH LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH export LD_LIBRARY_PATH fi PATH=$XBINDIR:$PATH # Adjust PATH /laclin/lacutil/single-instance --wait --usepid \ '/program/wolf4sdl --windowed\b' \ $XBINDIR/wolf4sdl --windowed --resf $WID $HGT & exit fi #--------------------------------------------------------------------- # Display a missing-program dialog. TITLE="$PROGNAME isn't installed" /laclin/lacutil/single-instance \ --wait --usewin "^$TITLE" \ zenity --error --no-wrap --title="$TITLE" --text="$TITLE"