summaryrefslogtreecommitdiff
path: root/play.sh
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-06-14 23:26:35 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-06-14 23:26:35 +0200
commite474a290b7f5edfa4e6bd4d061b48487b258fc77 (patch)
tree6009034c2b30fe474a82eab8c5a4c1a9c7c5b998 /play.sh
parent4bb7847fcea402970380c581428ccd17794e0a26 (diff)
downloadplay-e474a290b7f5edfa4e6bd4d061b48487b258fc77.tar.gz
play-e474a290b7f5edfa4e6bd4d061b48487b258fc77.tar.bz2
play-e474a290b7f5edfa4e6bd4d061b48487b258fc77.zip
Add torchlight; fix argument escaping
Diffstat (limited to 'play.sh')
-rwxr-xr-xplay.sh17
1 files changed, 12 insertions, 5 deletions
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