From 878b439fb9dda53e3159ae6e21775d1c22f8643d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Mon, 10 Sep 2012 23:59:29 +0200 Subject: Split 'prepare' in setupX and prepare -- this allows to cleanup even after killing X --- play.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'play.sh') diff --git a/play.sh b/play.sh index e683a7e..9c881da 100755 --- a/play.sh +++ b/play.sh @@ -149,13 +149,13 @@ ENV[DISPLAY]=":1" # phase functions {{{1 # Array of phases -PHASES=(startX setenv run prepare cleanup) +PHASES=(setenv prepare setupX startX run cleanup) declare -r PHASES # starts a new X # if overridden, this MUST call `$BIN --in-X` play_startX () { - exc -e startx $BIN --in-X $GAME -- $DISPLAY -ac -br -quiet ${=EXARGS} + exc startx $BIN --in-X $GAME -- $DISPLAY -ac -br -quiet ${=EXARGS} } # populate the environment @@ -189,12 +189,16 @@ play_run () { exc wineserver -w } -# prepare things for the game, e.g. mount ISOs -play_prepare () { +# manipulate the newly created X instance +play_setupX () { # set display size [[ -n $SIZE ]] && exc xrandr -s $SIZE } +# prepare things for the game, e.g. mount ISOs +play_prepare () { +} + # cleanup after yourself play_cleanup () { } @@ -262,9 +266,8 @@ EOF _continue_in_X () { # {{{2 _load - prepare + setupX run - cleanup } _run () { #{{{2 @@ -282,7 +285,9 @@ _run () { #{{{2 out "Launching '$GAME'" _load setenv + prepare startX + cleanup fi } -- cgit v1.2.3