[Tip] Random game list creation
pjft last edited by pjft
I wanted to share a small hack that I put together as I was feeling the need to relive the old days of randomly walking into an arcade and seeing what they had.
I created a small script in ~/RetroPie/retropiemenu (in my case, myarcade.sh) that runs the following:
ls /home/pi/RetroPie/roms/arcade/*.zip | shuf -n 15 > ~/.emulationstation/collections/custom-+my\ arcade.cfg sudo killall omxplayer.bin;sudo killall emulationstation;bash /opt/retropie/configs/all/autostart.sh
In this case, what it does is that it:
- lists all the games I have in the arcade folder (*.zip)
- randomly selects 15 of those,
- outputs it to a custom collection that, in my case, is called "+my arcade",
- and then kills ES, OMXPlayer and restarts ES, so that the new collection is loaded. If your RetroPie is set up to load Kodi on boot, then this won't do, as it'll start Kodi instead.
This way, when I want to try new games, every other week or so, I just refresh the list and then stick to what I have there.
I know it's not an especially common use case or need, but I thought I'd share in case there's anyone else there with similar quirks as me. :)
- For the collection to show up, you'll need to restart ES if the collection didn't exist yet.
- If you refresh the collection with ES open, you will need to reload the collection for the new games to show. Probably opening the collections menu, removing it, and then opening the menu again and loading it again might do the trick, if not restarting ES will be your best friend.
Maybe someone would rather have this as an auto-start script. This can also be used for other systems with small adjustments - my use case was for arcade games, so that's that.
Hope all is well with everyone!
Edit: removed sudo per mitu's recommendation, and added the line to restart ES just in case :)
simpleethat last edited by
That's a cool idea!
That's a neat idea. However, don't use
sudo- it's not needed.
pjft last edited by
@mitu thanks! Updated the command:)