Get name of the game beeing played
-
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 -
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. -
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.
-
@paolo.dellunto theres a ticket for it as well:
-
Looked on the old forums and this was my original post:
http://blog.petrockblock.com/forums/search/?bbp_search=romwatch
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.