From cdcc489daa083cbc138b2d289fe706467a27b71d Mon Sep 17 00:00:00 2001 From: Roy <88516395+moraroy@users.noreply.github.com> Date: Sun, 5 May 2024 01:29:52 -0700 Subject: [PATCH] Added an "Update Proton GE Button" ~command line ready --- NonSteamLaunchers.sh | 92 +++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 44 deletions(-) diff --git a/NonSteamLaunchers.sh b/NonSteamLaunchers.sh index 0e6e0e1..a7f6a0b 100755 --- a/NonSteamLaunchers.sh +++ b/NonSteamLaunchers.sh @@ -296,6 +296,47 @@ get_sd_path() { echo $sd_path } +#Function For Updating Proton-GE +function download_ge_proton() { + echo "Downloading GE-Proton using the GitHub API" + cd "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" + curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .tar.gz)" + curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .sha512sum)" + sha512sum -c ./*.sha512sum + tar -xf GE-Proton*.tar.gz -C "${logged_in_home}/.steam/root/compatibilitytools.d/" + proton_dir=$(find "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) + echo "All done :)" +} + +function update_proton() { + echo "0" + echo "# Detecting, Updating and Installing GE-Proton" + + # check to make sure compatabilitytools.d exists and makes it if it doesnt + if [ ! -d "${logged_in_home}/.steam/root/compatibilitytools.d" ]; then + mkdir -p "${logged_in_home}/.steam/root/compatibilitytools.d" + fi + + # Create NonSteamLaunchersInstallation subfolder in Downloads folder + mkdir -p "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" + + # Set the path to the Proton directory + proton_dir=$(find "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) + + # Check if GE-Proton is installed + if [ -z "$proton_dir" ]; then + download_ge_proton + else + # Check if installed version is the latest version + installed_version=$(basename $proton_dir | sed 's/GE-Proton-//') + latest_version=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep tag_name | cut -d '"' -f 4) + if [ "$installed_version" != "$latest_version" ]; then + download_ge_proton + fi + fi +} + + # Check which app IDs are installed CheckInstallations CheckInstallationDirectory @@ -312,7 +353,7 @@ separate_app_ids=false # Check if any command line arguments were provided if [ ${#args[@]} -eq 0 ]; then # No command line arguments were provided, so display the main zenity window - selected_launchers=$(zenity --list --text="Which launchers do you want to download and install?" --checklist --column="$version" --column="Default = one App ID Installation, One Prefix, NonSteamLaunchers - updated the NSLGameScanner.py $live" FALSE "SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX" $epic_games_value "$epic_games_text" $gog_galaxy_value "$gog_galaxy_text" $uplay_value "$uplay_text" $battlenet_value "$battlenet_text" $amazongames_value "$amazongames_text" $eaapp_value "$eaapp_text" $legacygames_value "$legacygames_text" $itchio_value "$itchio_text" $humblegames_value "$humblegames_text" $indiegala_value "$indiegala_text" $rockstar_value "$rockstar_text" $glyph_value "$glyph_text" $minecraft_value "$minecraft_text" $psplus_value "$psplus_text" $vkplay_value "$vkplay_text" FALSE "Fortnite" FALSE "Xbox Game Pass" FALSE "GeForce Now" FALSE "Amazon Luna" FALSE "Netflix" FALSE "Hulu" FALSE "Disney+" FALSE "Amazon Prime Video" FALSE "movie-web" FALSE "Youtube" FALSE "Twitch" --width=800 --height=740 --extra-button="Uninstall" --extra-button="Stop NSLGameScanner" --extra-button="Start Fresh" --extra-button="Move to SD Card") + selected_launchers=$(zenity --list --text="Which launchers do you want to download and install?" --checklist --column="$version" --column="Default = one App ID Installation, One Prefix, NonSteamLaunchers - updated the NSLGameScanner.py $live" FALSE "SEPARATE APP IDS - CHECK THIS TO SEPARATE YOUR PREFIX" $epic_games_value "$epic_games_text" $gog_galaxy_value "$gog_galaxy_text" $uplay_value "$uplay_text" $battlenet_value "$battlenet_text" $amazongames_value "$amazongames_text" $eaapp_value "$eaapp_text" $legacygames_value "$legacygames_text" $itchio_value "$itchio_text" $humblegames_value "$humblegames_text" $indiegala_value "$indiegala_text" $rockstar_value "$rockstar_text" $glyph_value "$glyph_text" $minecraft_value "$minecraft_text" $psplus_value "$psplus_text" $vkplay_value "$vkplay_text" FALSE "Fortnite" FALSE "Xbox Game Pass" FALSE "GeForce Now" FALSE "Amazon Luna" FALSE "Netflix" FALSE "Hulu" FALSE "Disney+" FALSE "Amazon Prime Video" FALSE "movie-web" FALSE "Youtube" FALSE "Twitch" --width=800 --height=740 --extra-button="Uninstall" --extra-button="Stop NSLGameScanner" --extra-button="Start Fresh" --extra-button="Move to SD Card" --extra-button="Update Proton-GE") # Check if the user clicked the 'Cancel' button or selected one of the extra buttons if [ $? -eq 1 ] || [[ $selected_launchers == "Start Fresh" ]] || [[ $selected_launchers == "Move to SD Card" ]] || [[ $selected_launchers == "Uninstall" ]]; then @@ -895,52 +936,15 @@ fi # Massive subshell pipes into `zenity --progress` around L2320 for GUI rendering ( -echo "0" -echo "# Detecting, Updating and Installing GE-Proton" +#Update Proton GE +# Call the function directly +update_proton -# check to make sure compatabilitytools.d exists and makes it if it doesnt -if [ ! -d "${logged_in_home}/.steam/root/compatibilitytools.d" ]; then - mkdir -p "${logged_in_home}/.steam/root/compatibilitytools.d" +# Also call the function when the button is pressed +if [[ $options == *"Update Proton-GE"* ]]; then + update_proton fi -# Create NonSteamLaunchersInstallation subfolder in Downloads folder -mkdir -p "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" - -# Set the path to the Proton directory -proton_dir=$(find "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) - -# Check if GE-Proton is installed -if [ -z "$proton_dir" ]; then - # Download GE-Proton using the GitHub API - echo "Downloading GE-Proton using the GitHub API" - cd "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" - curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .tar.gz)" - curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .sha512sum)" - sha512sum -c ./*.sha512sum - tar -xf GE-Proton*.tar.gz -C "${logged_in_home}/.steam/root/compatibilitytools.d/" - proton_dir=$(find "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) - echo "All done :)" -else - # Check if installed version is the latest version - installed_version=$(basename $proton_dir | sed 's/GE-Proton-//') - latest_version=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep tag_name | cut -d '"' -f 4) - if [ "$installed_version" != "$latest_version" ]; then - # Download GE-Proton using the GitHub API - echo "Downloading GE-Proton using the GitHub API" - cd "${logged_in_home}/Downloads/NonSteamLaunchersInstallation" - curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .tar.gz)" - curl -sLOJ "$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4 | grep .sha512sum)" - sha512sum -c ./*.sha512sum - tar -xf GE-Proton*.tar.gz -C "${logged_in_home}/.steam/root/compatibilitytools.d/" - proton_dir=$(find "${logged_in_home}/.steam/root/compatibilitytools.d" -maxdepth 1 -type d -name "GE-Proton*" | sort -V | tail -n1) - echo "All done :)" - fi -fi - - - - - echo "10" echo "# Setting files in their place"