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

    Get name of the game beeing played

    Scheduled Pinned Locked Moved Ideas and Development
    5 Posts 4 Posters 1.8k 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.
    • P
      paolo.dellunto
      last edited by

      Hithere,
      I'm adding a 16x2 LCD screen to my retropie station and I want it to have multiple informations by pressing a switch. Anyone has an idea on how to get the name of the game running in python or bash code ?
      Thanks
      Paolo Dell'Unto

      herb_fargusH 1 Reply Last reply Reply Quote 0
      • Z
        Zigurana
        last edited by

        I think the easiest way would be to hook it into the runcommand launcher, as all games are launched from that.
        That should give you the emulator and ROM name.
        Have a look at https://github.com/RetroPie/RetroPie-Setup/blob/0951d9d3581588822a5b66e2d990f8c7b5a17341/scriptmodules/supplementary/runcommand/runcommand.sh and see if you can understand what happens there.

        If tetris has thought me anything, it's that errors pile up and that accomplishments dissappear.

        1 Reply Last reply Reply Quote 0
        • S
          sselph
          last edited by sselph

          I wrote something to do this a while back. I don't actively use it but it might still work since ES hasn't really changed in over a year. It works by parsing the es_systems.cfg for the commands used to start systems then uses that and monitors all running processes for those commands. When it finds one it parses the gamelist for the roms nicer looking name and fires an event. This can be polled via a local web api (via wget/curl) or a script can be executed that accepts the system and game as paramenters.

          The code is here https://github.com/sselph/rp-tool/tree/master/rw/cmd/romwatch and the binaries are here if you don't want to compile https://github.com/sselph/rp-tool/releases If this seems interesting to you, I can read it over again and write some better documentation and test it again.

          Auto-scraper: https://github.com/sselph/scraper
          Donate to Extra-Life 2018 and help save lives: https://goo.gl/diu5oU

          1 Reply Last reply Reply Quote 0
          • herb_fargusH
            herb_fargus administrators @paolo.dellunto
            last edited by

            @paolo.dellunto theres a ticket for it as well:

            https://github.com/RetroPie/RetroPie-Setup/issues/1358

            If you read the documentation it will answer 99% of your questions: https://retropie.org.uk/docs/

            Also if you want a solution to your problems read this first: https://retropie.org.uk/forum/topic/3/read-this-first

            1 Reply Last reply Reply Quote 0
            • S
              sselph
              last edited by

              Looked on the old forums and this was my original post:
              http://blog.petrockblock.com/forums/search/?bbp_search=romwatch

              Auto-scraper: https://github.com/sselph/scraper
              Donate to Extra-Life 2018 and help save lives: https://goo.gl/diu5oU

              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.