From 0b333d107e68f7116833987afa98e8b4d0742d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 9 Sep 2012 15:26:45 +0200 Subject: Zsh Enhancements --- play.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'play.sh') diff --git a/play.sh b/play.sh index dd0dc0c..41840be 100755 --- a/play.sh +++ b/play.sh @@ -10,9 +10,9 @@ PLAY_GAMES="${PLAY_GAMES:-$PLAY_DIR/installed}" PLAY_TEMPLATES="${PLAY_TEMPLATES:-$PLAY_DIR/templates}" typeset -A ENV EENV -BIN=$0 +BIN=${0:A} -PLAY_BIN=${PLAY_BIN:-$BIN} +PLAY_BIN=${PLAY_BIN:-$0} # }}} # global functions {{{ @@ -140,10 +140,10 @@ play_setenv () { play_run () { # cd into dir local dir="$(exc winepath -u $GPATH)" - exc cd "$(dirname $dir)" + exc cd "${dir:h}" # start game - exc wine start $GPATH "$ARGS" + exc wine start ${dir:t} "$ARGS" # wait for wine to shutdown exc wineserver -w @@ -157,7 +157,11 @@ EXPORT play execute prepare setenv run cleanup _list () { out "The installed games are:" - for k in $PLAY_GAMES/*(.,@:t); do + # on -> sort alphabetically + # N -> NULL_GLOB -> no error message if no match + # .,@ -> regular files or symbolic links (, == or) + # :t -> modifier: only basename + for k in $PLAY_GAMES/*(onN.,@:t); do echo "\t> $k" done } -- cgit v1.2.3