From e474a290b7f5edfa4e6bd4d061b48487b258fc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 14 Jun 2010 23:26:35 +0200 Subject: Add torchlight; fix argument escaping --- play.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'play.sh') diff --git a/play.sh b/play.sh index 3c8a4ed..973669a 100755 --- a/play.sh +++ b/play.sh @@ -18,9 +18,9 @@ exc () { sleep 3 if [[ -n $fork ]]; then - exec $@ &! + exec "$@" &! else - eval $@ + eval "$@" fi } @@ -41,8 +41,14 @@ if [[ $1 == "-x" ]]; then exp WINEDEBUG "-all" exp DISPLAY ":1" - exc wine start $gpath $args + # start game + exc wine start $gpath "$args" + + # wait for wine to shutdown exc wineserver -w + + # when the script reaches this point, + # the new X will be terminated else local game=$1 @@ -57,13 +63,14 @@ else gpath="c:/Programme/steam/steam.exe" size="1280x1024" - [[ $# > 0 ]] && args=$@ + [[ $# > 0 ]] && args="-applaunch ${=@}" } typeset -A games games[bg2]='gpath=c:/spiele/bg2/baldur.exe; size=1024x768' games[fallout]='prefix=~/.fallout/; gpath=c:/spiele/fallout/falloutw.exe; size=800x600; x11args="-depth 16"' games[steam]='steam' + games[torchlight]='steam 41600' if [[ -z $games[$game] ]]; then echo "*** Game '$game' not found" @@ -76,5 +83,5 @@ else eval $games[$game] fi - exc -f startx $0 -x $prefix $gpath $size "$args" -- :1 -ac -br -quiet ${=x11args} + exc -f startx $0 -x $prefix $gpath $size $args -- :1 -ac -br -quiet ${=x11args} fi -- cgit v1.2.3