diff --git a/es-configs/es_settings.xml b/es-configs/es_settings.xml index 08e3cc4c..bf0cf3c6 100644 --- a/es-configs/es_settings.xml +++ b/es-configs/es_settings.xml @@ -42,17 +42,17 @@ - - - + + + - + - - + + diff --git a/es-configs/tools-gamelist.xml b/es-configs/tools-gamelist.xml index 5d0c4b99..b1341252 100644 --- a/es-configs/tools-gamelist.xml +++ b/es-configs/tools-gamelist.xml @@ -63,4 +63,32 @@ true true + + ./move-roms.sh + Move roms folder + Move roms folder from internal to external and vice versa. + true + true + + + ./overlays.sh + Overlays configuration + Configure or disable borders and shaders. + true + true + + + ./theme-fix.sh + Theme fix + Clean some of the scraped data in order to beautify the new theme. This is needed if you got scraped data since v0.4.2 or earlier. + true + true + + + ./configure-emulators.sh + Configure Emulators + Choose an emulator to configure. + true + true + \ No newline at end of file diff --git a/global.sh b/global.sh new file mode 100755 index 00000000..280344a8 --- /dev/null +++ b/global.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# This file is containing some global function needed for the script such as the config file tools + +rd_conf="/app/retrodeck/retrodeck.cfg" + +conf_init() { + # initializing and reading the retrodeck config file + if [ ! -f $rd_conf ] + then # I have to initialize the variables as they cannot be red from an empty config file + touch $rd_conf + + # Variables to manage: adding a variable here means adding it to conf_write() + version="$(cat /app/retrodeck/version)" # version info taken from the version file + rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodeck + roms_folder="$rdhome/roms" # default roms folder location (intenral) + + else # i just read the variables + source $rd_conf + fi +} + +conf_write() { + # writes the variables in the retrodeck config file + + # TODO: this can be optimized with a while and a list of variables to check + if [ ! -z "$version" ] then #if the variable is not null then I update it + sed -i "s%version=.*%version=$version%" $rd_conf + fi + + if [ ! -z "$rdhome" ] then + sed -i "s%rdhome=.*%rdhome=$rdhome%" $rd_conf + fi + + if [ ! -z "$roms_folder" ] then + sed -i "s%rdhome=.*%rdhome=$roms_folder" $rd_conf + fi + +} \ No newline at end of file diff --git a/net.retrodeck.retrodeck.appdata.xml b/net.retrodeck.retrodeck.appdata.xml index bca1fc9a..51b11426 100644 --- a/net.retrodeck.retrodeck.appdata.xml +++ b/net.retrodeck.retrodeck.appdata.xml @@ -43,7 +43,32 @@ CC0-1.0 - + + https://github.com/XargonWan/RetroDECK/releases/tag/0.4.2b + +

Frontend:

+
    +
  • Theme revamp: for a proper theme visualization please run Theme fix tool in order to delete some old scraped data that breaks it.
  • +
+ +

Backend:

+
    +
  • New varialbes system: now some variables such as game folder location are saved in /app/retrodeck/retrodeck.cfg.
  • +
+ +

Known Issues:

+
    +
  • PCSX2: due to its limitation, the standalone PCSX2 doesn't have any way to set the hotkeys, so no save and load state, no quit button. In order to quit press: STEAM -> PCSX2 -> (X) CLOSE WINDOW, be aware that the state is not automatically saved
  • +
  • Due to a Steam limitation, external controllers and keyboard seems not to be working, expecially in the desktop mode
  • +
+ +

IMPORTANT NOTE: + At the moment the emulator configs are reset during every update, this was made because every version they may bring new configurations, please back them up if you did some manual configs. +

+
+
+ + https://github.com/XargonWan/RetroDECK/releases/tag/0.4.2b

Emulators:

diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 4dca818a..0226f630 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1158,6 +1158,9 @@ modules: - cp retrodeck.sh /app/bin/retrodeck.sh - chmod +x /app/bin/retrodeck.sh + + - cp global.sh /app/bin/global.sh + - chmod +x /app/bin/global.sh # Desktop entry - cp net.retrodeck.retrodeck.desktop /app/share/applications/net.retrodeck.retrodeck.desktop @@ -1193,4 +1196,4 @@ modules: sources: - type: git url: https://github.com/XargonWan/RetroDECK.git - branch: main \ No newline at end of file + branch: main diff --git a/retrodeck.sh b/retrodeck.sh index 7089303b..098131b7 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -1,10 +1,15 @@ #!/bin/bash +# Init default values, this may be overwritten by retrodeck.cfg as it sourced later with global.sh + lockfile="$HOME/retrodeck/.lock" # where the lockfile is located -version="$(cat /app/retrodeck/version)" # version info taken from the version file -rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodecck emuconfigs="/app/retrodeck/emu-configs" # folder with all the default emulator configs sdcard="/run/media/mmcblk0p1" # Steam Deck SD default path +rd_conf="/app/retrodeck/retrodeck.cfg" # RetroDECK config file path +version="$(cat /app/retrodeck/version)" # version info taken from the version file +rdhome="$HOME/retrodeck" # the retrodeck home, aka ~/retrodeck + +source global.sh # Functions area @@ -49,26 +54,6 @@ dir_prep() { echo -e "$symlink is now $real\n" } -cfg_init() { - # Initializing retrodeck config file - #rdconf=/var/config/retrodeck/retrodeck.cfg - - # if I got a config file already I parse it - #if [] - - #else - # touch $rdconf - #fi - - #$roms_folder > /var/config/retrodeck/retrodeck.cfg - return -} - -# is_mounted() { -# # This script checks if the provided path in $1 is mounted -# mount | awk -v DIR="$1" '{if ($3 == DIR) { exit 0}} ENDFILE{exit -1}' -# } - tools_init() { rm -rfv /var/config/retrodeck/tools/ mkdir -pv /var/config/retrodeck/tools/ @@ -308,7 +293,8 @@ https://retrodeck.net exit ;; --version*|-v*) - cat /var/config/retrodeck/version + conf_init + echo $version exit ;; --reset-ra*) @@ -341,7 +327,9 @@ done if [ -f "$lockfile" ] && [ "$(cat "$lockfile")" != "$version" ]; then echo "Lockfile version is "$(cat "$lockfile")" but the actual version is $version" - post_update + conf_init # Initializing/reading the config file (sourced from global.sh) + post_update # Executing post update script + conf_write # Writing variables in the config file (sourced from global.sh) start_retrodeck exit 0 fi @@ -351,7 +339,9 @@ fi if [ ! -f "$lockfile" ]; then echo "Lockfile not found" - finit + conf_init # Initializing/reading the config file (sourced from global.sh) + finit # Executing First/Force init + conf_write # Writing variables in the config file (sourced from global.sh) exit 0 fi diff --git a/tools/clean-miximages.sh b/tools/clean-miximages.sh deleted file mode 100644 index e11b17e6..00000000 --- a/tools/clean-miximages.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -zenity \ ---icon-name=net.retrodeck.retrodeck \ ---question \ ---no-wrap \ ---window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ ---title "RetroDECK" \ ---ok-label "Yes" \ ---cancel-label "No" \ ---text="This tool is will clean the MixImages in order to beautify the theme.\nDo you want to delete them?" - -if [ $? == 0 ] #yes - Internal -then - find ~/retrodeck/.downloaded_media -name miximages -type d -print0|xargs -0 rm -rfv -- -fi - -zenity \ ---icon-name=net.retrodeck.retrodeck \ ---info \ ---no-wrap \ ---window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ ---title "RetroDECK" \ ---text="Miximages successfully cleaned, please restart RetroDECK to reload the games list." \ No newline at end of file diff --git a/tools/configure-emulators.sh b/tools/configure-emulators.sh index a7a2d8d9..f1722182 100644 --- a/tools/configure-emulators.sh +++ b/tools/configure-emulators.sh @@ -6,12 +6,12 @@ then exit 0 fi -border="$(zenity --list \ +emulator="$(zenity --list \ --title "RetroDECK" \ --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ --text="Which emulator do you want to configure?" \ --hide-header \ ---column=Border \ +--column=emulator \ "RetroArch" \ "Citra" \ "Dolphin" \ @@ -21,28 +21,28 @@ border="$(zenity --list \ "RPCS3" \ "Yuzu")" -if [ $border == "RetroArch" ] +if [ $emulator == "RetroArch" ] then retroarch -elif [ $border == "Citra" ] +elif [ $emulator == "Citra" ] then citra-qt -elif [ $border == "Dolphin" ] +elif [ $emulator == "Dolphin" ] then dolphin-emu -elif [ $border == "MelonDS" ] +elif [ $emulator == "MelonDS" ] then melonDS -elif [ $border == "PCSX2" ] +elif [ $emulator == "PCSX2" ] then pcsx2 -elif [ $border == "PPSSPP" ] +elif [ $emulator == "PPSSPP" ] then PPSSPPSDL -elif [ $border == "RPCS3" ] +elif [ $emulator == "RPCS3" ] then rpcs3 -elif [ $border == "Yuzu" ] +elif [ $emulator == "Yuzu" ] then yuzu fi \ No newline at end of file diff --git a/tools/move-roms.sh b/tools/move-roms.sh index a6bfafce..85b83fc8 100644 --- a/tools/move-roms.sh +++ b/tools/move-roms.sh @@ -1,29 +1,32 @@ #!/bin/bash -if [ -d ~/retrodeck/roms ] && [ -d /run/media/mmcblk0p1/retrodeck/roms ] -then # found both internal and sd folders - zenity --title "RetroDECK" --warning --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --text="I found a roms folder both in internal and SD Card,\nin order to make this tool useful you should remove one of the two or merge them." +source global.sh + +zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="Quit" --ok-label "Continue" --text="WARNING: this script is experimental\nplease be sure to backup your data before continuing.\n\nDo you want to continue?" +if [ $? == 1 ] #cancel +then exit 0 fi -if [ -d ~/retrodeck/roms ] && [ ! -d /run/media/mmcblk0p1/retrodeck/roms ] -then # found internal folder and not the external - roms_path=~/retrodeck - new_roms_path=/run/media/mmcblk0p1/retrodeck +conf_init + +zenity --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --cancel-label="Cancel" --ok-label "Browse" --text="The roms folder is now: $roms_folder\nplease select the new location.\nA retrodeck/roms folder will be created starting from the directory that you selected." +if [ $? == 1 ] #cancel +then + exit 0 fi -if [ ! -d ~/retrodeck/roms ] && [ -d /run/media/mmcblk0p1/retrodeck/roms ] -then # found external folder and not the internal - roms_path=/run/media/mmcblk0p1/retrodeck - new_roms_path=~/retrodeck -fi +new_roms_path="$(zenity --file-selection --title="Choose a new roms folder location" --directory)"/retrodeck/roms -zenity --title "RetroDECK" --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --text="Should I move the roms from\n\n$roms_path/roms\n\nto\n\n$new_roms_path/roms?" +zenity --title "RetroDECK" --question --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --text="Should I move the roms from\n\n$roms_folder\n\nto\n\n$new_roms_path?" if [ $? == 0 ] #yes then mkdir -p $new_roms_path - mv -f $roms_path/roms $new_roms_path/roms + mv -f $roms_folder $new_roms_path rm -f /var/config/emulationstation/ROMs - ln -s $new_roms_path/roms /var/config/emulationstation/ROMs - rm -f $roms_path/roms + ln -s $new_roms_path /var/config/emulationstation/ROMs + rm -f $roms_folder + zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --text="Done\nYour roms are now located in:\n\n$roms_folder\n\nPress OK to continue." + $roms_folder=$new_roms_path # Updating variable + conf_write # Writing variables in the config file (sourced from global.sh) fi diff --git a/tools/theme-fix.sh b/tools/theme-fix.sh new file mode 100644 index 00000000..b3712e9f --- /dev/null +++ b/tools/theme-fix.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +zenity \ +--icon-name=net.retrodeck.retrodeck \ +--question \ +--no-wrap \ +--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ +--title "RetroDECK" \ +--ok-label "Yes" \ +--cancel-label "No" \ +--text="This tool is will clean some unuseful scraped data in order to beautify the theme.\nDo you want to delete them?" + +if [ $? == 0 ] #yes - Internal +then + find ~/retrodeck/.downloaded_media -name miximages -type d -print0|xargs -0 rm -rfv -- + find ~/retrodeck/.downloaded_media -name 3dboxes -type d -print0|xargs -0 rm -rfv -- + find ~/retrodeck/.downloaded_media -name titlescreens -type d -print0|xargs -0 rm -rfv -- + find ~/retrodeck/.downloaded_media -name backcovers -type d -print0|xargs -0 rm -rfv -- + find ~/retrodeck/.downloaded_media -namephysicalmedia -type d -print0|xargs -0 rm -rfv -- + find ~/retrodeck/.downloaded_media -namescreenshots -type d -print0|xargs -0 rm -rfv -- +fi + +zenity \ +--icon-name=net.retrodeck.retrodeck \ +--info \ +--no-wrap \ +--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \ +--title "RetroDECK" \ +--text="Scraped data is now cleaned, please restart RetroDECK to reload the games list." \ No newline at end of file