From f4ca43e4de9de42c5ba759e0a1fcc15660500644 Mon Sep 17 00:00:00 2001 From: Mikhail Tergoev Date: Sat, 28 Dec 2024 18:51:35 +0300 Subject: [PATCH] update create shortcut for EGS --- data_from_portwine/scripts/functions_helper | 25 ++++++++------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/data_from_portwine/scripts/functions_helper b/data_from_portwine/scripts/functions_helper index 78ed054..481d235 100755 --- a/data_from_portwine/scripts/functions_helper +++ b/data_from_portwine/scripts/functions_helper @@ -4375,24 +4375,17 @@ portwine_launch () { [[ $PW_LOG != 1 ]] && debug_timer --start -s "PW_TIME_IN_GAME" if [[ -n "${LAUNCH_URI}" ]] ; then pw_run start /high /b "${LAUNCH_URI}" & - unset portwine_eg + unset GAMEPID while true ; do - if [[ -z $portwine_eg ]] ; then - if [[ $portwine_exe =~ .bat$ ]] ; then - portwine_eg=$(grep .exe "$portwine_exe" | tail -n 1) - portwine_eg=${portwine_eg//.exe/} - portwine_eg=${portwine_eg//[[:blank:]]*/} - portwine_eg=${portwine_eg//*[[:punct:]]/} - portwine_eg=${portwine_eg}.exe - else - portwine_eg=$(basename "$portwine_exe") - fi - fi - sleep 1 - if [[ -z $GAMEPID ]] ; then - GAMEPID="$(pgrep -fa "$portwine_eg" | grep -v "start.sh" | awk '{print $1}')" + sleep 5 + if [[ -z "$GAMEPID" ]] ; then + GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}')" else - waitpid "$GAMEPID" && break + if waitpid "$GAMEPID" ; then + sleep 1 + GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}')" + [[ -z "$GAMEPID" ]] && break || continue + fi fi done else