From 9e523c321789de603c275e27e5ed71229967e54d Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:11:59 -0800 Subject: [PATCH] Add files via upload --- NonSteamLaunchers.sh | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index aa91086..df25ff2 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -65,16 +65,17 @@ curl -o $python_script_path $github_link # Define the path to the env_vars file env_vars="${logged_in_home}/.config/systemd/user/env_vars" + # Check if the env_vars file exists if [ -f "$env_vars" ]; then # If the file exists, run the .py file echo "env_vars file found. Running the .py file..." python3 $python_script_path - live="and is live." + live="and is LIVE." else # If the file does not exist, do not run the .py file echo "env_vars file not found. Not running the .py file." - live="and is not live." + live="and is NOT LIVE." fi #End of Rough way of updating the .py for users @@ -814,7 +815,7 @@ function StartFreshFunction { rm -rf ${logged_in_home}/.config/systemd/user/nslgamescanner.service # Remove the symlink - unlink /home/deck/.config/systemd/user/default.target.wants/nslgamescanner.service + unlink ${logged_in_home}/.config/systemd/user/default.target.wants/nslgamescanner.service # Reload the systemd user instance systemctl --user daemon-reload @@ -1162,8 +1163,9 @@ if [[ $options == "Move to SD Card" ]]; then exit 1 fi -# Check if the user clicked the "Stop NSLGameScanner" button -if [[ $options == "Stop NSLGameScanner" ]]; then + +# Check if the Stop NSLGameScanner option was passed as a command line argument or clicked in the GUI +if [[ " ${args[@]} " =~ " Stop NSLGameScanner " ]] || [[ $options == "Stop NSLGameScanner" ]]; then # Delete the service file rm -rf ${logged_in_home}/.config/systemd/user/nslgamescanner.service @@ -1173,7 +1175,12 @@ if [[ $options == "Stop NSLGameScanner" ]]; then # Reload the systemd user instance systemctl --user daemon-reload - # Display the zenity window in the background + # If command line arguments were provided, exit the script + if [ ${#args[@]} -ne 0 ]; then + exit 0 + fi + + # If no command line arguments were provided, display the zenity window zenity --question --text="NSLGameScanner has been stopped. Do you want to run it again?" --width=200 --height=150 if [ $? = 0 ]; then # User wants to run NSLGameScanner again @@ -1186,6 +1193,7 @@ fi + # Check if the user clicked the "Find Games" button if [[ $options == "Find Games" ]]; then # The Find Games button was clicked @@ -2660,7 +2668,7 @@ if [[ -f "${logged_in_home}/.steam/root/config/loginusers.vdf" ]]; then steamid3=$((current_steamid - 76561197960265728)) # Directly map steamid3 to userdata folder - userdata_folder="/home/deck/.steam/root/userdata/${steamid3}" + userdata_folder="${logged_in_home}/.steam/root/userdata/${steamid3}" # Check if userdata_folder exists if [[ -d "$userdata_folder" ]]; then