#!/bin/sh APP=ryujinx if [ -z "$APP" ]; then exit 1; fi SITE="Ryujinx/release-channel-master" # CREATE THE FOLDER mkdir /opt/$APP cd /opt/$APP # ADD THE REMOVER echo '#!/bin/sh' >> /opt/$APP/remove echo "rm -rf \"/usr/share/applications/AM-$APP.desktop\" \"/opt/$APP\" \"/usr/local/bin/$APP\"" >> /opt/$APP/remove chmod a+x /opt/$APP/remove # DOWNLOAD THE ARCHIVE mkdir tmp cd ./tmp version=$(curl -Ls https://api.github.com/repos/$SITE/releases | jq '.' | grep browser_download_url | grep -i linux_x64.tar.gz | cut -d '"' -f 4 | head -1) wget $version echo "$version" >> /opt/$APP/version tar fx ./*tar* && rm -rf "./*tar*" cd .. mv --backup=t ./tmp/*/* ./ rm -rf "./tmp" # LINK ln -s /opt/$APP/Ryujinx.sh /usr/local/bin/$APP chmod a+x /opt/$APP/Ryujinx.sh # SCRIPT TO UPDATE THE PROGRAM cat >> /opt/$APP/AM-updater << 'EOF' #!/usr/bin/env bash APP=ryujinx if [ -z "$APP" ]; then exit 1; fi SITE="Ryujinx/release-channel-master" version0=$(cat /opt/$APP/version) version=$(curl -Ls https://api.github.com/repos/$SITE/releases | jq '.' | grep browser_download_url | grep -i linux_x64.tar.gz | cut -d '"' -f 4 | head -1) if [ $version = $version0 ]; then echo "Update not needed!" else notify-send "A new version of $APP is available, please wait" mkdir /opt/$APP/tmp cd /opt/$APP/tmp wget $version tar fx ./*tar* && rm -rf "./*tar*" cd .. mv --backup=t ./tmp/*/* ./ rm ./version echo $version >> ./version rm -rf "./tmp" ./*~ notify-send "$APP is updated!" fi EOF chmod a+x /opt/$APP/AM-updater # ICON mkdir icons wget https://raw.githubusercontent.com/Ryujinx/Ryujinx/master/src/Ryujinx/Ryujinx.ico -O ./icons/$APP 2> /dev/null # LAUNCHER rm -f "/usr/share/applications/AM-$APP.desktop" echo "[Desktop Entry] Version=1.0 Name=Ryujinx Type=Application Icon=/opt/$APP/icons/$APP Exec=/opt/$APP/Ryujinx.sh %f Comment=A Nintendo Switch Emulator GenericName=Nintendo Switch Emulator Terminal=false Categories=Game;Emulator; MimeType=application/x-nx-nca;application/x-nx-nro;application/x-nx-nso;application/x-nx-nsp;application/x-nx-xci; Keywords=Switch;Nintendo;Emulator; StartupWMClass=Ryujinx PrefersNonDefaultGPU=true" >> /usr/share/applications/AM-$APP.desktop