From 52a5949e47d40fa0ef22ed8af80f6078043527a8 Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Thu, 25 Jan 2024 20:22:09 -0800 Subject: [PATCH] re-arranged en_vars to be written before deatchment ~moved compat tool before detatchment --- NonSteamLaunchers.sh | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 9a50fe3..71cf3ab 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -2657,16 +2657,6 @@ else echo "Current user's userdata folder not found" 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 # Pre check for updating the config file @@ -2690,6 +2680,28 @@ fi +# Write variables to a file before script is detached +echo "export steamid3=$steamid3" >> ${logged_in_home}/.config/systemd/user/env_vars +echo "export logged_in_home=$logged_in_home" >> ${logged_in_home}/.config/systemd/user/env_vars +echo "export compat_tool_name=$compat_tool_name" >> ${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 + + + + + + # Set the path to the configset_controller_neptune.vdf file controller_config_path="${logged_in_home}/.local/share/Steam/steamapps/common/Steam Controller Configs/$steamid3/config/configset_controller_neptune.vdf" @@ -3118,12 +3130,6 @@ rm -rf "$download_dir" #Setup NSLGameScanner.service -# Write variables to a file -echo "export steamid3=$steamid3" >> ${logged_in_home}/.config/systemd/user/env_vars -echo "export logged_in_home=$logged_in_home" >> ${logged_in_home}/.config/systemd/user/env_vars -echo "export compat_tool_name=$compat_tool_name" >> ${logged_in_home}/.config/systemd/user/env_vars - - # Define your Python script path python_script_path="${logged_in_home}/.config/systemd/user/NSLGameScanner.py"