#!/bin/bash #--------------------------------------------------------------------- # File information. # File: tscgame.wrapper.in # Purpose: Single-instance wrapper (Laclin-specific) # License: BSD-style (for this file only) # Revision: 211023 #--------------------------------------------------------------------- # Wrapper parameters. BASEDIR=$PRODTREE/tscgame BINDIR=$BASEDIR/bin LIBDIR=$BASEDIR/lib SNDFLAG=true TARGET=$BINDIR/tscgame-bridge PROGNAME="Secret Chronicles" #--------------------------------------------------------------------- # Run the target if it's available. if [ -f $TARGET ]; then # Run the target cd # Go to user's home directory if [ \! -d ".config/tsc" ]; then mkdir -p .config cd .config rm -fr tsc cfgtsc # Safety measure # Populate "tsc" directory unzip -qo $BASEDIR/data/cfgtsc.zip || exit 1 mv cfgtsc tsc cd .. fi cd .config/tsc if [ \! -f config.xml ]; then rm -fr config.xml unzip -qo $BASEDIR/data/cfgtsc.zip cfgtsc/config.xml mv cfgtsc/config.xml . rm -fr cfgtsc fi dim=`getx11dim` xs=`echo $dim | sed -e 's/x.*//'` zs=`echo $dim | sed -e 's/.*x//'` sed \ -e 's@"video_fullscreen" value="0"@"video_fullscreen" value="1"@' \ -e 's@"video_screen_w".*@"video_screen_w" value="'$xs'"/>@' \ -e 's@"video_screen_h".*@"video_screen_h" value="'$zs'"/>@' \ -i config.xml #--------------------------------------------------------------------- cd # Go to user's home directory 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=$BINDIR:$PATH # Adjust PATH /laclin/lacutil/single-instance --wait --usewin \ "^The Secret Chronicles of Dr. M\b" \ $TARGET $* & 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"