From 8b97bd55984728f6155a6ec97236815b836f24ac Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:32:49 -0800 Subject: [PATCH] moved Steam restart process to the end of script --- NonSteamLaunchers.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index b9e643f..cac1fef 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -2697,16 +2697,6 @@ echo "export python_version=$python_version" >> ${logged_in_home}/.config/system echo "export chromedirectory=$chromedirectory" >> ${logged_in_home}/.config/systemd/user/env_vars echo "export chrome_startdir=$chrome_startdir" >> ${logged_in_home}/.config/systemd/user/env_vars -# Detach script from Steam process -nohup sh -c 'sleep 10; /usr/bin/steam' & - -# Close all instances of Steam -steam_pid() { pgrep -x steam ; } -steam_running=$(steam_pid) -[[ -n "$steam_running" ]] && killall steam - -# Wait for the steam process to exit -while steam_pid > /dev/null; do sleep 5; done @@ -2769,6 +2759,16 @@ python3 $python_script_path +# Detach script from Steam process +nohup sh -c 'sleep 10; /usr/bin/steam' & + +# Close all instances of Steam +steam_pid() { pgrep -x steam ; } +steam_running=$(steam_pid) +[[ -n "$steam_running" ]] && killall steam + +# Wait for the steam process to exit +while steam_pid > /dev/null; do sleep 5; done # TODO: might be better to relocate temp files to `/tmp` or even use `mktemp -d` since `rm -rf` is potentially dangerous without the `-i` flag