From 14f0dbe079bd900f7c536d9d028e91d97e1e9b3d Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Fri, 26 Jan 2024 19:13:10 -0800 Subject: [PATCH] Added Some logic to help the decky plugin --- NonSteamLaunchers.sh | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index abe4e0c..ab84ac9 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -43,8 +43,19 @@ check_for_updates() { } +# Get the command line arguments +args=("$@") +# Check if "Decky Plugin" is one of the arguments +decky_plugin=false +for arg in "${args[@]}"; do + if [ "$arg" = "Decky Plugin" ]; then + decky_plugin=true + break + fi +done + # Rough way to "update" the .py for users that already had the service file # Define the repository and the folders to clone repo_url='https://github.com/moraroy/NonSteamLaunchers-On-Steam-Deck/archive/refs/heads/main.zip' @@ -109,6 +120,26 @@ curl -o $python_script_path $github_link env_vars="${logged_in_home}/.config/systemd/user/env_vars" +# Check if the env_vars file exists and the decky_plugin argument is set +if [ -f "$env_vars" ] && [ "$decky_plugin" = true ]; then + # If the file exists and the decky_plugin argument is set, run the .py file + echo "env_vars file found and Decky Plugin argument set. Running the .py file..." + python3 $python_script_path + live="and is LIVE." + # Exit the script after running the .py file + exit 0 +else + # If the file does not exist or the decky_plugin argument is not set, do not run the .py file + echo "env_vars file not found or Decky Plugin argument not set. Not running the .py file." + live="and is NOT LIVE." +fi + + + + + + + # Check if the env_vars file exists if [ -f "$env_vars" ]; then # If the file exists, run the .py file @@ -124,8 +155,7 @@ fi -# Get the command line arguments -args=("$@") + # Check if any command line arguments were provided if [ ${#args[@]} -eq 0 ]; then