Enable SSH on the Retropie, will be easier to go back if needed
Edit /opt/retropie/configs/all/autostart.sh
Replace emulationstation #auto
with the following
ls ~/RetroPie/roms/gb |sort -R |tail -1 |while read file; do
trimfile=$(echo $file | rev | cut -c 4- | rev)
/opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ gb ~/RetroPie/roms/gb/"$trimfile".7z
done
A few things to note here
- emulationstation/runcommand.sh does not handle files with spaces very well, and you can't just wrap the entire path in quotes
"like/this path with/spaces.7z"
. Instead you literally wrap just the file name in quotes. - My test roms all had the .7z extension on them. So that second line there is trimming the extension off the filename, since you also can't just wrap the filename + extension in quotes.
like/this/"file name with spaces.7z"
RetroPie FAQ link - https://retropie.org.uk/docs/FAQ/#how-would-i-start-from-command-line-say-the-snes-emulator-by-itself