Added rewind tool (missing racfg location)

This commit is contained in:
XargonWan 2022-09-05 17:11:54 +02:00
parent b7a45fe419
commit 41d9f21992
2 changed files with 30 additions and 0 deletions

View file

@ -98,4 +98,11 @@
<nogamecount>true</nogamecount>
<nomultiscrape>true</nomultiscrape>
</game>
<game>
<path>./rewind.sh</path>
<name>Rewind toggler</name>
<desc>Enable or disable the rewind function for some RetroArch cores.</desc>
<nogamecount>true</nogamecount>
<nomultiscrape>true</nomultiscrape>
</game>
</gameList>

23
tools/rewind.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
racfg=""
zenity --question \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="Do you want to enable the rewind function in RetroArch cores?\n\nNOTE:\nThis may impact on performances expecially on the latest systems."
if [ $? == 0 ] #yes, enable
then
sed -i 's%rewind_enable = .*%rewind_enable = "true"' $racfg
zenity --info \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="Rewind enabled\!\nYou can check on Libretro docs to see which cores supports this function."
else # no, disable
sed -i 's%rewind_enable = .*%rewind_enable = "false"' $racfg
zenity --info \
--no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
--title "RetroDECK" \
--text="Rewind disabled."
fi