Frontend:
+Backend:
+Known Issues:
+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. +
+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