From 583ef3b7e14bcbd7175f8748658393e9c4625aab Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 2 Nov 2024 11:27:07 -0700 Subject: [PATCH 1/2] Fix xwayland-game-wrapper --- xwayland-game-wrapper | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xwayland-game-wrapper b/xwayland-game-wrapper index d2b9699..f8ae85b 100755 --- a/xwayland-game-wrapper +++ b/xwayland-game-wrapper @@ -88,8 +88,9 @@ done (( "${OPTIND}" > ${#} )) && print_help "${0}" shift $(( "${OPTIND}" - 1)) -{ - set -e +function () { + emulate -L zsh + setopt errexit [[ -v window_manager ]] || window_manager='openbox' [[ -v current_desktop ]] || @@ -105,7 +106,7 @@ function on_sigchld { exit 1 } -trap on_sigchld CHLD +#trap on_sigchld CHLD coproc Xwayland -fullscreen -geometry "${resolution}" -displayfd 1 local xwayland_display @@ -118,8 +119,11 @@ cat <&p >&2 let cat_pid="${!}" sh -c "exec -- ${window_manager}" & - sh -c "exec -- ${@}" +let child_error_code="${?}" +if (( ${child_error_code} )); then + printf 'Child exited with error code %d\n' "${child_error_code}" +fi trap - kill %sh %Xwayland From ef54cca933394589a497f361c809be96ca0e0cf4 Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sat, 2 Nov 2024 12:04:22 -0700 Subject: [PATCH 2/2] Fix xwayland-game-wrapper, again --- xwayland-game-wrapper | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/xwayland-game-wrapper b/xwayland-game-wrapper index f8ae85b..a7b5399 100755 --- a/xwayland-game-wrapper +++ b/xwayland-game-wrapper @@ -88,7 +88,7 @@ done (( "${OPTIND}" > ${#} )) && print_help "${0}" shift $(( "${OPTIND}" - 1)) -function () { +function { emulate -L zsh setopt errexit [[ -v window_manager ]] || @@ -106,7 +106,7 @@ function on_sigchld { exit 1 } -#trap on_sigchld CHLD +trap on_sigchld CHLD coproc Xwayland -fullscreen -geometry "${resolution}" -displayfd 1 local xwayland_display @@ -119,7 +119,10 @@ cat <&p >&2 let cat_pid="${!}" sh -c "exec -- ${window_manager}" & -sh -c "exec -- ${@}" +function { + emulate -L sh + eval "${@}" +} "${@}" let child_error_code="${?}" if (( ${child_error_code} )); then printf 'Child exited with error code %d\n' "${child_error_code}"