RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    [Tip] Random game list creation

    Scheduled Pinned Locked Moved Ideas and Development
    randomizerarcade gamesscript
    4 Posts 3 Posters 350 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pjftP
      pjft
      last edited by pjft

      Hi.

      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. :)

      Some notes:

      • 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 :)

      1 Reply Last reply Reply Quote 6
      • simpleethatS
        simpleethat
        last edited by

        That's a cool idea!

        1 Reply Last reply Reply Quote 1
        • mituM
          mitu Global Moderator
          last edited by

          That's a neat idea. However, don't use sudo - it's not needed.

          pjftP 1 Reply Last reply Reply Quote 1
          • pjftP
            pjft @mitu
            last edited by

            @mitu thanks! Updated the command:)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.