From 36f5fb370c3ebe0c7a049c6cfe2cd550781cd1b1 Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Fri, 10 Feb 2017 14:43:51 +0100 Subject: [PATCH] still fixing wine exe, lnk and dosbox calls...by the way simplify script --- exelaunch.sh | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/exelaunch.sh b/exelaunch.sh index 4bf8571..caf1b3d 100755 --- a/exelaunch.sh +++ b/exelaunch.sh @@ -8,28 +8,24 @@ # 2017-02-07 Start work on this # -function get_interpreter() { - local EXE="$1" - - echo "$(basename "${EXE}")" >&2 - - case "$(file -b "${EXE}")" in - *DOS*) - local CONFIG="${HOME}/.dosbox/$(basename "${EXE}").conf" - if [ ! \( -e "${CONFIG}" \) ] - then - cp "${HOME}/.dosbox/dosbox-SVN.conf" "${CONFIG}" - fi - echo -n "/usr/bin/dosbox -exit -conf ${CONFIG}" - ;; - *Windows\ shortcut*) echo -n "/usr/bin/wine start";; - *Windows*) echo -n "/usr/bin/wine";; - esac -} - EXE="$1"; shift -WINEXE="${EXE/${WINEPREFIX}drive_c/C:}" -WINEXE="${WINEXE//\//\\}" -exec $(get_interpreter "${EXE}") "${WINEXE}" "$@" + +case "$(file -b "${EXE}")" in + *DOS*) + local CONFIG="${HOME}/.dosbox/$(basename "${EXE}").conf" + if [ ! \( -e "${CONFIG}" \) ] + then + cp "${HOME}/.dosbox/dosbox-SVN.conf" "${CONFIG}" + fi + exec /usr/bin/dosbox -exit -conf "${CONFIG}" "${EXE}" "$@" + ;; + *Windows\ shortcut*) + WINEXE="${EXE/${WINEPREFIX}drive_c/C:}" + WINEXE="${WINEXE//\//\\}" + exec /usr/bin/wine start "${WINEXE}" "$@" + ;; + *Windows*) exec /usr/bin/wine "${EXE}" "$@";; + *) exec "${EXE}" "${@}";; +esac # vim: ft=sh ts=4 sw=4: