diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index cac1fef..df6dbf4 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -2722,7 +2722,16 @@ fi +# 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 @@ -2759,16 +2768,7 @@ 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