2022-08-06 03:44:31 -04:00
#!/bin/bash
#variables
ESDE_toolName = "EmulationStation-DE"
ESDE_toolType = "AppImage"
2023-10-10 16:20:54 -04:00
ESDE_toolPath = " ${ toolsPath } /EmulationStation-DE.AppImage "
2023-04-26 02:43:47 -04:00
ESDE_releaseURL = "https://gitlab.com/es-de/emulationstation-de/-/package_files/76389058/download" #default URl in case of issues parsing json
ESDE_releaseMD5 = "b749b927d61317fde0250af9492a4b9f" #default hash
ESDE_prereleaseURL = ""
ESDE_prereleaseMD5 = ""
ESDE_releaseJSON = "https://gitlab.com/es-de/emulationstation-de/-/raw/master/latest_release.json"
2023-10-06 09:46:45 -04:00
ESDE_addSteamInputFile = " $EMUDECKGIT /configs/steam-input/emulationstation-de_controller_config.vdf "
steam_input_templateFolder = " $HOME /.steam/steam/controller_base/templates/ "
2022-08-06 03:44:31 -04:00
es_systemsFile = " $HOME /.emulationstation/custom_systems/es_systems.xml "
2023-10-05 02:27:11 -04:00
es_rulesFile = " $HOME /.emulationstation/custom_systems/es_find_rules.xml "
2022-08-06 03:44:31 -04:00
es_settingsFile = " $HOME /.emulationstation/es_settings.xml "
2023-04-26 02:43:47 -04:00
ESDE_SetAppImageURLS( ) {
local json = " $( curl -s $ESDE_releaseJSON ) "
ESDE_releaseURL = $( echo " $json " | jq -r '.stable.packages[] | select(.name == "LinuxSteamDeckAppImage") | .url' )
ESDE_releaseMD5 = $( echo " $json " | jq -r '.stable.packages[] | select(.name == "LinuxSteamDeckAppImage") | .md5' )
ESDE_prereleaseURL = $( echo " $json " | jq -r '.prerelease.packages[] | select(.name == "LinuxSteamDeckAppImage") | .url' )
ESDE_prereleaseMD5 = $( echo " $json " | jq -r '.prerelease.packages[] | select(.name == "LinuxSteamDeckAppImage") | .md5' )
}
2022-08-06 03:44:31 -04:00
#cleanupOlderThings
ESDE_cleanup( ) {
echo "NYI"
}
2023-10-10 16:20:54 -04:00
ESDE_migration( ) {
if [ -f " ${ toolsPath } /EmulationStation-DE-x64_SteamDeck.AppImage " ] ; then
mv " ${ toolsPath } /EmulationStation-DE-x64_SteamDeck.AppImage " " ${ toolsPath } /EmulationStation-DE.AppImage "
sed -i "s|EmulationStation-DE-x64_SteamDeck.AppImage|EmulationStation-DE.AppImage|g" " $toolsPath /launchers/esde/emulationstationde.sh "
2023-11-02 14:43:11 -04:00
ESDE_createDesktopShortcut
2023-10-10 16:20:54 -04:00
fi
}
2023-11-02 14:43:11 -04:00
ESDE_createDesktopShortcut( ) {
mkdir -p " $toolsPath /launchers/esde "
cp " $EMUDECKGIT /tools/launchers/esde/emulationstationde.sh " " $toolsPath /launchers/esde/emulationstationde.sh "
rm -rf $HOME /.local/share/applications/EmulationStation-DE.desktop
createDesktopShortcut " $HOME /.local/share/applications/EmulationStation-DE.desktop " \
"EmulationStation-DE AppImage" \
" ${ toolsPath } /launchers/esde/emulationstationde.sh " \
"false"
}
ESDE_uninstall( ) {
rm -rf " ${ toolsPath } /EmulationStation-DE.AppImage "
rm -rf $HOME /.local/share/applications/EmulationStationDE.desktop
}
2022-08-06 03:44:31 -04:00
#Install
ESDE_install( ) {
2023-04-26 02:43:47 -04:00
ESDE_SetAppImageURLS
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
setMSG " Installing $ESDE_toolName "
2022-08-06 03:44:31 -04:00
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
local showProgress = " $1 "
2023-11-02 14:43:11 -04:00
local filename = " $ESDE_toolName . $ESDE_toolType "
2023-04-26 02:43:47 -04:00
if [ [ $ESDE_releaseURL = "https://gitlab.com/es-de/emulationstation-de/-/package_files/" * ] ] ; then
2023-10-10 16:20:54 -04:00
2023-10-06 09:46:45 -04:00
if installToolAI " $ESDE_toolName " " $ESDE_releaseURL " "" " $showProgress " ; then
2023-11-02 14:43:11 -04:00
ESDE_createDesktopShortcut
2023-10-06 09:46:45 -04:00
else
return 1
fi
2023-10-10 16:20:54 -04:00
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
else
setMSG " $ESDE_toolName not found "
return 1
2023-10-02 12:54:38 -04:00
fi
2022-08-06 03:44:31 -04:00
}
2023-10-06 09:46:45 -04:00
# ESDE20_install(){
# ESDE_SetAppImageURLS
# setMSG "Installing $ESDE_toolName PreRelease"
2023-10-10 16:20:54 -04:00
#
2023-10-06 09:46:45 -04:00
# local showProgress="$1"
2023-10-10 16:20:54 -04:00
#
2023-10-06 09:46:45 -04:00
# if [[ $ESDE_prereleaseURL = "https://gitlab.com/es-de/emulationstation-de/-/package_files/"* ]]; then
2023-10-10 16:20:54 -04:00
#
2023-10-06 09:46:45 -04:00
# if safeDownload "$ESDE_toolName" "$ESDE_prereleaseURL" "$ESDE_toolPath" "$showProgress"; then
# ESDE_md5sum=($(md5sum $ESDE_toolPath)) # get first element
# if [ "$ESDE_md5sum" == "$ESDE_prereleaseMD5" ]; then
# echo "ESDE PASSED HASH CHECK."
# chmod +x "$ESDE_toolPath"
# else
# echo "ESDE FAILED HASH CHECK. Expected $ESDE_prereleaseMD5, got $ESDE_md5sum"
# fi
# else
# return 1
# fi
# else
# setMSG "$ESDE_toolName PreRelease not found, installing stable"
# if ESDE_install; then
# :
# else
# return 1
# fi
# fi
# }
2022-12-31 13:32:39 -05:00
2022-08-06 03:44:31 -04:00
#ApplyInitialSettings
ESDE_init( ) {
2023-10-02 12:54:38 -04:00
setMSG " Setting up $ESDE_toolName "
2022-08-06 03:44:31 -04:00
mkdir -p " $HOME /.emulationstation/custom_systems/ "
2022-08-23 14:11:45 -04:00
rsync -avhp --mkpath " $EMUDECKGIT /configs/emulationstation/es_settings.xml " " $( dirname " $es_settingsFile " ) " --backup --suffix= .bak
rsync -avhp --mkpath " $EMUDECKGIT /configs/emulationstation/custom_systems/es_systems.xml " " $( dirname " $es_systemsFile " ) " --backup --suffix= .bak
2023-10-02 12:54:38 -04:00
2023-10-06 09:46:45 -04:00
cp -r " $EMUDECKGIT /tools/launchers/esde/ " " $toolsPath /launchers/esde/ " && chmod +x " $toolsPath /launchers/esde/emulationstationde.sh "
2023-10-10 16:20:54 -04:00
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ESDE_addCustomSystems
ESDE_setEmulationFolder
ESDE_setDefaultEmulators
2023-11-02 14:43:11 -04:00
ESDE_applyTheme " $esdeThemeUrl " " $esdeThemeName "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ESDE_migrateDownloadedMedia
2023-03-06 02:13:57 -05:00
ESDE_addSteamInputProfile
2023-03-26 03:30:36 -04:00
ESDE_symlinkGamelists
ESDE_finalize
2023-03-13 14:42:01 -04:00
ESDE_migrateEpicNoir
2023-10-02 12:54:38 -04:00
2023-11-02 14:43:11 -04:00
if [ " $system " = = "chimeraos" ] || [ " $system " = = "ChimeraOS" ] ; then
ESDE_chimeraOS
fi
}
ESDE_chimeraOS( ) {
if [ ! -f $es_rulesFile ] ; then
rsync -avhp --mkpath " $EMUDECKGIT /chimeraOS/configs/emulationstation/custom_systems/es_find_rules.xml " " $( dirname " $es_rulesFile " ) " --backup --suffix= .bak
else
xmlstarlet ed -d '//entry[contains(., "~/Applications/RetroArch-Linux*.AppImage") or contains(., "~/.local/share/applications/RetroArch-Linux*.AppImage") or contains(., "~/.local/bin/RetroArch-Linux*.AppImage") or contains(., "~/bin/RetroArch-Linux*.AppImage")]' $es_rulesFile > rules_temp.xml && mv rules_temp.xml $es_rulesFile
fi
2022-08-06 03:44:31 -04:00
}
2023-03-21 12:45:20 -04:00
ESDE_resetConfig( ) {
2023-03-15 11:45:15 -04:00
ESDE_init & >/dev/null && echo "true" || echo "false"
}
2023-10-06 09:46:45 -04:00
# ESDE20_init(){
# ESDE_init
# }
2023-01-23 12:32:46 -05:00
2022-08-06 03:44:31 -04:00
ESDE_update( ) {
2023-10-02 12:54:38 -04:00
setMSG " Setting up $ESDE_toolName "
2022-08-06 03:44:31 -04:00
mkdir -p " $HOME /.emulationstation/custom_systems/ "
#update es_settings.xml
2022-08-23 14:11:45 -04:00
rsync -avhp --mkpath " $EMUDECKGIT /configs/emulationstation/es_settings.xml " " $( dirname " $es_settingsFile " ) " --ignore-existing
rsync -avhp --mkpath " $EMUDECKGIT /configs/emulationstation/custom_systems/es_systems.xml " " $( dirname " $es_systemsFile " ) " --ignore-existing
2022-08-06 03:44:31 -04:00
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ESDE_addCustomSystems
2022-08-06 03:44:31 -04:00
ESDE_setEmulationFolder
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ESDE_setDefaultEmulators
2023-11-02 14:43:11 -04:00
ESDE_applyTheme " $esdeThemeUrl " " $esdeThemeName "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ESDE_migrateDownloadedMedia
2023-03-06 02:13:57 -05:00
ESDE_addSteamInputProfile
2023-03-26 03:30:36 -04:00
ESDE_symlinkGamelists
ESDE_finalize
2022-08-06 03:44:31 -04:00
}
ESDE_addCustomSystems( ) {
#insert cemu custom system if it doesn't exist, but the file does
2023-01-23 23:03:12 -05:00
if [ [ $( grep -rnw " $es_systemsFile " -e 'wiiu' ) = = "" ] ] ; then
xmlstarlet ed -S --inplace --subnode '/systemList' --type elem --name 'system' \
2022-08-06 03:44:31 -04:00
--var newSystem '$prev' \
--subnode '$newSystem' --type elem --name 'name' -v 'wiiu' \
--subnode '$newSystem' --type elem --name 'fullname' -v 'Nintendo Wii U' \
--subnode '$newSystem' --type elem --name 'path' -v '%ROMPATH%/wiiu/roms' \
--subnode '$newSystem' --type elem --name 'extension' -v '.rpx .RPX .wud .WUD .wux .WUX .elf .ELF .iso .ISO .wad .WAD .wua .WUA' \
2023-01-23 23:03:12 -05:00
--subnode '$newSystem' --type elem --name 'commandP' -v " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -w -f -g z:%ROM% " \
--insert '$newSystem/commandP' --type attr --name 'label' --value "Cemu (Proton)" \
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
--subnode '$newSystem' --type elem --name 'commandN' -v " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -f -g %ROM% " \
2023-01-23 23:03:12 -05:00
--insert '$newSystem/commandN' --type attr --name 'label' --value "Cemu (Native)" \
2022-08-06 03:44:31 -04:00
--subnode '$newSystem' --type elem --name 'platform' -v 'wiiu' \
--subnode '$newSystem' --type elem --name 'theme' -v 'wiiu' \
2023-01-23 23:03:12 -05:00
-r 'systemList/system/commandP' -v 'command' \
-r 'systemList/system/commandN' -v 'command' \
2022-08-06 03:44:31 -04:00
" $es_systemsFile "
2023-01-23 23:03:12 -05:00
#format doc to make it look nice
xmlstarlet fo " $es_systemsFile " > " $es_systemsFile " .tmp && mv " $es_systemsFile " .tmp " $es_systemsFile "
2022-08-06 03:44:31 -04:00
fi
#Custom Systems config end
}
#update
ESDE_applyTheme( ) {
2023-11-02 14:43:11 -04:00
local themeUrl = $1
local themeName = $2
2023-04-26 02:45:24 -04:00
2023-11-02 14:43:11 -04:00
echo " ESDE: applyTheme $themeName "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
mkdir -p " $HOME /.emulationstation/themes/ "
2023-11-02 14:43:11 -04:00
if [ -d " $HOME /.emulationstation/themes/ $themeName " ] ; then
cd " $HOME /.emulationstation/themes/ $themeName " && git pull
else
git clone $themeUrl " $HOME /.emulationstation/themes/ "
fi
sed -i " s/<string name=\"ThemeSet\" value=\"[^\"]*\"/<string name=\"ThemeSet\" value=\" $themeName \"/ " " $es_settingsFile "
2023-04-26 02:45:24 -04:00
2022-08-06 03:44:31 -04:00
}
2023-11-02 14:43:11 -04:00
2022-08-06 03:44:31 -04:00
#ConfigurePaths
ESDE_setEmulationFolder( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
#update cemu custom system launcher to correct path by just replacing the line, if it exists.
2022-08-06 03:44:31 -04:00
echo " updating $es_systemsFile "
2023-01-23 23:03:12 -05:00
#insert new commands
if [ [ ! $( grep -rnw " $es_systemsFile " -e 'wiiu' ) = = "" ] ] ; then
if [ [ $( grep -rnw " $es_systemsFile " -e 'Cemu (Proton)' ) = = "" ] ] ; then
#insert
xmlstarlet ed -S --inplace --subnode 'systemList/system[name="wiiu"]' --type elem --name 'commandP' -v " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -w -f -g z:%ROM% " \
--insert 'systemList/system/commandP' --type attr --name 'label' --value "Cemu (Proton)" \
-r 'systemList/system/commandP' -v 'command' \
" $es_systemsFile "
#format doc to make it look nice
xmlstarlet fo " $es_systemsFile " > " $es_systemsFile " .tmp && mv " $es_systemsFile " .tmp " $es_systemsFile "
else
#update
cemuProtonCommandString = " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -w -f -g z:%ROM% "
xmlstarlet ed -L -u '/systemList/system/command[@label="Cemu (Proton)"]' -v " $cemuProtonCommandString " " $es_systemsFile "
fi
if [ [ $( grep -rnw " $es_systemsFile " -e 'Cemu (Native)' ) = = "" ] ] ; then
#insert
xmlstarlet ed -S --inplace --subnode 'systemList/system[name="wiiu"]' --type elem --name 'commandN' -v " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -f -g %ROM% " \
--insert 'systemList/system/commandN' --type attr --name 'label' --value "Cemu (Native)" \
-r 'systemList/system/commandN' -v 'command' \
" $es_systemsFile "
#format doc to make it look nice
xmlstarlet fo " $es_systemsFile " > " $es_systemsFile " .tmp && mv " $es_systemsFile " .tmp " $es_systemsFile "
else
#update
cemuNativeCommandString = " /usr/bin/bash ${ toolsPath } /launchers/cemu.sh -f -g %ROM% "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
xmlstarlet ed -L -u '/systemList/system/command[@label="Cemu (Native)"]' -v " $cemuNativeCommandString " " $es_systemsFile "
2023-01-23 23:03:12 -05:00
fi
fi
2023-03-26 02:54:59 -04:00
if [ [ ! $( grep -rnw " $es_systemsFile " -e 'xbox360' ) = = "" ] ] ; then
if [ [ $( grep -rnw " $es_systemsFile " -e 'Xenia (Proton)' ) = = "" ] ] ; then
#insert
xmlstarlet ed -S --inplace --subnode 'systemList/system[name="xbox360"]' --type elem --name 'commandP' -v " /usr/bin/bash ${ toolsPath } /launchers/xenia.sh %ROM% " \
--insert 'systemList/system/commandP' --type attr --name 'label' --value "Xenia (Proton)" \
-r 'systemList/system/commandP' -v 'command' \
" $es_systemsFile "
#format doc to make it look nice
xmlstarlet fo " $es_systemsFile " > " $es_systemsFile " .tmp && mv " $es_systemsFile " .tmp " $es_systemsFile "
else
#update
xeniaProtonCommandString = " /usr/bin/bash ${ toolsPath } /launchers/xenia.sh %ROM% "
xmlstarlet ed -L -u '/systemList/system/command[@label="Xenia (Proton)"]' -v " $xeniaProtonCommandString " " $es_systemsFile "
fi
fi
2022-08-06 03:44:31 -04:00
echo " updating $es_settingsFile "
#configure roms Directory
2022-10-06 00:54:35 -04:00
esDE_romDir = " <string name=\"ROMDirectory\" value=\" ${ romsPath } \" /> " #roms
2023-10-02 12:54:38 -04:00
2022-08-06 03:44:31 -04:00
changeLine '<string name="ROMDirectory"' " ${ esDE_romDir } " " $es_settingsFile "
2023-10-02 12:54:38 -04:00
2022-08-06 03:44:31 -04:00
#Configure Downloaded_media folder
2022-10-06 00:54:35 -04:00
esDE_MediaDir = " <string name=\"MediaDirectory\" value=\" ${ ESDEscrapData } \" /> "
2022-08-06 03:44:31 -04:00
#search for media dir in xml, if not found, change to ours. If it's blank, also change to ours.
mediaDirFound = $( grep -rnw " $es_settingsFile " -e 'MediaDirectory' )
mediaDirEmpty = $( grep -rnw " $es_settingsFile " -e '<string name="MediaDirectory" value="" />' )
2023-01-23 23:03:12 -05:00
mediaDirEmulation = $( grep -rnw " $es_settingsFile " -e 'Emulation/tools/downloaded_media' )
2022-08-06 03:44:31 -04:00
if [ [ $mediaDirFound = = '' ] ] ; then
echo " adding ES-DE ${ esDE_MediaDir } "
sed -i -e '$a' " ${ esDE_MediaDir } " " $es_settingsFile " # use config file instead of link
2023-01-23 23:03:12 -05:00
elif [ [ -z $mediaDirEmpty || -n $mediaDirEmulation ] ] ; then
2022-08-06 03:44:31 -04:00
echo " setting ES-DE MediaDirectory to ${ esDE_MediaDir } "
changeLine '<string name="MediaDirectory"' " ${ esDE_MediaDir } " " $es_settingsFile "
fi
}
ESDE_setDefaultEmulators( ) {
#ESDE default emulators
mkdir -p " $HOME /.emulationstation/gamelists/ "
ESDE_setEmu 'Dolphin (Standalone)' gc
ESDE_setEmu 'PPSSPP (Standalone)' psp
ESDE_setEmu 'Dolphin (Standalone)' wii
ESDE_setEmu 'PCSX2 (Standalone)' ps2
ESDE_setEmu 'melonDS' nds
ESDE_setEmu 'Citra (Standalone)' n3ds
2022-08-30 16:40:48 -04:00
ESDE_setEmu 'Beetle Lynx' atarilynx
2022-10-17 09:49:07 -04:00
ESDE_setEmu 'DuckStation (Standalone)' psx
2022-10-06 00:54:35 -04:00
ESDE_setEmu 'Beetle Saturn' saturn
2022-09-24 20:05:45 -04:00
ESDE_setEmu 'ScummVM (Standalone)' scummvm
2022-08-06 03:44:31 -04:00
}
ESDE_migrateDownloadedMedia( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo "ESDE: Migrate Downloaded Media."
originalESMediaFolder = " $HOME /.emulationstation/downloaded_media "
echo " processing $originalESMediaFolder "
if [ -L " ${ originalESMediaFolder } " ] ; then
echo "link found"
unlink " ${ originalESMediaFolder } " && echo "unlinked"
elif [ -e " ${ originalESMediaFolder } " ] ; then
2023-10-02 12:54:38 -04:00
if [ -d " ${ originalESMediaFolder } " ] ; then
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo -e ""
2023-10-02 12:54:38 -04:00
echo -e " Moving EmulationStation-DE downloaded_media to $toolsPath "
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
echo -e ""
rsync -a " $originalESMediaFolder " " $toolsPath / " && rm -rf " $originalESMediaFolder " #move it, merging files if in both locations
fi
else
echo "downloaded_media not found on original location"
fi
2022-08-06 03:44:31 -04:00
}
#finalExec - Extra stuff
ESDE_finalize( ) {
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
#Symlinks for ESDE compatibility
2022-10-06 00:54:35 -04:00
cd $( echo $romsPath | tr -d '\r' )
binupdate improvements (#648)
* binupdate improvements
- new safeDownload() in helperFunctions
- introduced showProgress argument for emulator downloads
- modified binupdate.sh to use showProgress
- modified emulator/tools install functions to use safeDownload()/showProgress and return proper exit code (CemuNative, Cemu, mGBA, PCSX2-QT, Ryujinx, Vita3K, Xenia, Yuzu, ESDE, SRM)
- installEmuAI() and installEmuBI() are now using new safeDownload() and return proper exit code
- installEmuAI() and installEmuBI() can now write last version info (new arguments)
- yuzu launcher: Added ~/emudeck/yuzu.noupdate to skip yuzu update, zenity progress bar and zenity error dialog
* formatting/whitespaces only
* Fixed shell error (quotes)
---------
Co-authored-by: Livedeht <godsbane@gmail.com>
2023-03-05 23:45:34 -05:00
ln -sn gamecube gc
ln -sn 3ds n3ds
ln -sn arcade mamecurrent
ln -sn mame mame2003
ln -sn lynx atarilynx
2022-08-06 03:44:31 -04:00
}
2023-10-02 12:54:38 -04:00
ESDE_setEmu( ) {
2022-08-06 03:44:31 -04:00
local emu = $1
local system = $2
local gamelistFile = " $HOME /.emulationstation/gamelists/ $system /gamelist.xml "
if [ ! -f " $gamelistFile " ] ; then
mkdir -p " $HOME /.emulationstation/gamelists/ $system " && cp " $EMUDECKGIT /configs/emulationstation/gamelists/ $system /gamelist.xml " " $gamelistFile "
else
2022-10-06 00:54:35 -04:00
gamelistFound = $( grep -rnw " $gamelistFile " -e 'gameList' )
2022-08-06 03:44:31 -04:00
if [ [ $gamelistFound = = '' ] ] ; then
2022-10-06 00:54:35 -04:00
sed -i -e '$a\<gameList />' " $gamelistFile "
2022-08-06 03:44:31 -04:00
fi
2022-10-06 00:54:35 -04:00
alternativeEmu = $( grep -rnw " $gamelistFile " -e 'alternativeEmulator' )
2022-08-06 03:44:31 -04:00
if [ [ $alternativeEmu = = '' ] ] ; then
2022-10-06 00:54:35 -04:00
echo " <alternativeEmulator><label> $emu </label></alternativeEmulator> " >> " $gamelistFile "
2022-08-06 03:44:31 -04:00
fi
2022-10-06 00:54:35 -04:00
sed -i "s|<?xml version=\"1.0\">|<?xml version=\"1.0\"?>|g" " $gamelistFile "
2022-08-06 03:44:31 -04:00
fi
2023-02-07 11:20:07 -05:00
}
2023-03-03 19:16:47 -05:00
ESDE_addSteamInputProfile( ) {
2023-03-06 01:06:26 -05:00
addSteamInputCustomIcons
2023-03-03 19:16:47 -05:00
setMSG " Adding $ESDE_toolName Steam Input Profile. "
2023-10-06 09:46:45 -04:00
rsync -r " $ESDE_addSteamInputFile " " $steam_input_templateFolder "
2023-03-03 19:16:47 -05:00
}
2023-02-07 11:20:07 -05:00
ESDE_IsInstalled( ) {
if [ -e " $ESDE_toolPath " ] ; then
echo "true"
else
echo "false"
fi
2023-03-03 19:16:47 -05:00
}
2023-03-13 14:42:01 -04:00
2023-03-26 03:30:36 -04:00
ESDE_symlinkGamelists( ) {
linkToSaveFolder es-de gamelists " $HOME /.emulationstation/gamelists/ "
}
2023-03-13 14:42:01 -04:00
ESDE_migrateEpicNoir( ) {
2023-03-13 16:10:23 -04:00
FOLDER = " $HOME /.emulationstation/themes/es-epicnoir "
2023-10-02 12:54:38 -04:00
2023-03-13 16:07:47 -04:00
if [ -f " $FOLDER " ] ; then
2023-03-26 02:54:59 -04:00
rm -rf " $FOLDER "
2023-03-13 14:42:01 -04:00
git clone https://github.com/anthonycaccese/epic-noir-revisited-es-de " $HOME /.emulationstation/themes/epic-noir-revisited " --depth= 1
2023-10-02 12:54:38 -04:00
changeLine '<string name="ThemeSet"' '<string name="ThemeSet" value="epic-noir-revisited-es-de" />' " $es_settingsFile "
2023-03-13 14:42:01 -04:00
fi
2023-10-02 12:54:38 -04:00
}