diff --git a/functions/EmuScripts/emuDeckCitra.sh b/functions/EmuScripts/emuDeckCitra.sh old mode 100644 new mode 100755 index 866b47925..68486fb2d --- a/functions/EmuScripts/emuDeckCitra.sh +++ b/functions/EmuScripts/emuDeckCitra.sh @@ -1,10 +1,10 @@ #!/bin/bash #variables Citra_emuName="Citra" -Citra_emuType="FlatPak" -Citra_emuPath="org.citra_emu.citra" +Citra_emuType="AppImage" +Citra_emuPath="citra_emu" Citra_releaseURL="" -Citra_configFile="$HOME/.var/app/org.citra_emu.citra/config/citra-emu/qt-config.ini" +Citra_configFile="$HOME/.config/citra-emu/qt-config.ini" #cleanupOlderThings Citra_finalize(){ @@ -15,7 +15,8 @@ Citra_finalize(){ Citra_install(){ setMSG "Installing $Citra_emuName" installEmuFP "${Citra_emuName}" "${Citra_emuPath}" - flatpak override "${Citra_emuPath}" --filesystem=host --user + curl -L https://github.com/citra-emu/citra-web/releases/download/2.0/citra-setup-linux > citra-setup-linux && chmod +x citra-setup-linux && ./citra-setup-linux --accept-licenses --confirm-command install + rm citra-setup-linux } #ApplyInitialSettings @@ -31,7 +32,7 @@ Citra_init(){ #update Citra_update(){ setMSG "Updating $Citra_emuName settings." - configEmuFP "${Citra_emuName}" "${Citra_emuPath}" + cd $HOME/.citra && ./maintenancetool update Citra_setupStorage Citra_setEmulationFolder Citra_setupSaves @@ -48,35 +49,35 @@ Citra_setEmulationFolder(){ #Setup symlink for AES keys mkdir -p "${biosPath}/citra/" - mkdir -p "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sysdata" - ln -sn "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sysdata" "${biosPath}/citra/keys" + mkdir -p "$HOME/.local/share/citra-emu/sysdata" + ln -sn "$HOME/.local/share/citra-emu/sysdata" "${biosPath}/citra/keys" } #SetupSaves Citra_setupSaves(){ - linkToSaveFolder citra saves "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/sdmc" - linkToSaveFolder citra states "$HOME/.var/app/org.citra_emu.citra/data/citra-emu/states" + linkToSaveFolder citra saves "$HOME/.local/share/citra-emu/sdmc" + linkToSaveFolder citra states "$HOME/.local/share/citra-emu/states" } #SetupStorage Citra_setupStorage(){ - if [ ! -f "$storagePath/citra/nand" ] && [ -d "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" ]; then + if [ ! -f "$storagePath/citra/nand" ] && [ -d "$HOME/.local/share/citra-emu/nand/" ]; then echo "citra nand does not exist in storagepath." echo -e "" setMSG "Moving Citra nand to the Emulation/storage folder" echo -e "" - mv "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" $storagePath/citra/nand/ - mv "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/" $storagePath/citra/sdmc/ + mv "$HOME/.local/share/citra-emu/nand/" $storagePath/citra/nand/ + mv "$HOME/.local/share/citra-emu/sdmc/" $storagePath/citra/sdmc/ - unlink "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" - unlink "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/" + unlink "$HOME/.local/share/citra-emu/nand/" + unlink "$HOME/.local/share/citra-emu/sdmc/" - ln -ns "${storagePath}/citra/nand/" "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/nand/" - ln -ns "${storagePath}/citra/sdmc/" "$HOME/.var/app/org.ctira_emu.citra/data/citra-emu/sdmc/" + ln -ns "${storagePath}/citra/nand/" "$HOME/.local/share/citra-emu/nand/" + ln -ns "${storagePath}/citra/sdmc/" "$HOME/.local/share/citra-emu/sdmc/" fi } @@ -85,14 +86,14 @@ Citra_setupStorage(){ #WipeSettings Citra_wipe(){ setMSG "Wiping $Citra_emuName config directory. (factory reset)" - rm -rf "$HOME/.var/app/$Citra_emuPath" + rm -rf "$HOME/.config/citra-emu" } #Uninstall Citra_uninstall(){ setMSG "Uninstalling $Citra_emuName." - flatpak uninstall "$Citra_emuPath" --user -y + cd $HOME/.citra && ./maintenancetool purge } #setABXYstyle @@ -102,7 +103,31 @@ Citra_setABXYstyle(){ #Migrate Citra_migrate(){ -echo "NYI" +echo "Begin Citra Migration" + emu="Citra" + migrationFlag="$HOME/.config/EmuDeck/.${emu}MigrationCompleted" + #check if we have a nomigrateflag for $emu + if [ ! -f "$migrationFlag" ]; then + #citra flatpak to appimage + #From -- > to + migrationTable=() + migrationTable+=("$HOME/.var/app/org.citra_emu.citra/data/citra-emu" "$HOME/.local/share/citra-emu") + migrationTable+=("$HOME/.var/app/org.citra_emu.citra/config/citra-emu" "$HOME/.config/citra-emu") + + # migrateAndLinkConfig "$emu" "$migrationTable" + fi + + #move data from hidden folders out to these folders in case the user already put stuff here. + origPath="$HOME/.var/app/org.citra_emu.citra/data/citra_emu/" + + citra_setupStorage + + rsync -av "${origPath}citra/dump" "${storagePath}/citra/" && rm -rf "${origPath}citra/dump" + rsync -av "${origPath}citra/load" "${storagePath}/citra/" && rm -rf "${origPath}citra/load" + rsync -av "${origPath}citra/sdmc" "${storagePath}/citra/" && rm -rf "${origPath}citra/sdmc" + rsync -av "${origPath}citra/nand" "${storagePath}/citra/" && rm -rf "${origPath}citra/nand" + rsync -av "${origPath}citra/screenshots" "${storagePath}/citra/" && rm -rf "${origPath}citra/screenshots" + rsync -av "${origPath}citra/tas" "${storagePath}/citra/" && rm -rf "${origPath}citra/tas" } #WideScreenOn