Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Version selector #11

Open
moddie666 opened this issue Aug 31, 2021 · 0 comments
Open

Version selector #11

moddie666 opened this issue Aug 31, 2021 · 0 comments

Comments

@moddie666
Copy link

moddie666 commented Aug 31, 2021

not really sure how to simply send some changes/extra code, so here goes:
added a version selector to proton-ge-custom-updater.sh.
mostly just wrapped your code into a loop through selected urls, from the selector function.
this version requires bash (or maybe similary feature rich shells) because i did not want to figure out, how to do it without bash-isms ... :D
hope you may find some of this useful ;)

#!/bin/bash

# Installation routine
install() {
<UNCHANGED />
}

selections(){
   num=0
   echo
   for u in $RELEASE_URLS
   do if [ "$num" = "$press" ]
      then if [ "x$(egrep "^$u\$" .selections)" = "x" ]
           then #add selection
                echo "$u" >> .selections
           else #remove selection
                egrep -v "^$u\$" .selections > .sel
                mv .sel .selections
           fi
      fi
      if [ "x$(egrep "^$u\$" .selections)" != "x" ]
      then echo "(x)[$num] $(echo "$u" | sed "s|.*/||")"
      else echo "( )[$num] $(echo "$u" | sed "s|.*/||")"
      fi
      num=$(($num+1))
   done
   echo "(De)Select by entering a number (enter nothing to start):"
}


#GET tar.gz urls for all releases
RELEASE_URLS=$(curl -s "https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases" | awk -F '"' '/browser_download_url": ".*tar.gz/{print $4}')

press=blaeh
echo -n > .selections
while [ "x$press" != "x" ]
do read -p "--> Proton GE Installer by p-mng, Version Selection - $(selections)" press
done

for url in $(cat .selections)
do filename="$(echo "$url" | sed "s|.*/||")"
   echo "--> [$filename]"
   # Check if steam is installed regularly, either in one of the two locations
   if [ -d "$HOME/.local/share/Steam" ] || [ -d "$HOME/.steam" ]
   then echo "--> Regular Steam installation found. Installing..."
        install "$HOME/.local/share/Steam" || install "$HOME/.steam"
   else echo "--> Steam does not seem to be installed as a regular package. No changes were made."
   fi

   # Check if steam is installed as Flatpak
   if [ -d "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam" ] || [ -d "$HOME/.var/app/com.valvesoftware.Steam/.steam" ]
   then echo "--> Flatpak Steam installation found. Installing..."
        install "$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam" || install "$HOME/.var/app/com.valvesoftware.Steam/.steam"
   else echo "--> Steam does not seem to be installed as Flatpak. No changes were made."
   fi
done

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant