Hi Everyone,
I’m in the process of creating another tool and needed a library to monitor the state of emulationstation. Seemed like it could be useful on its own. I’ve seen people needing to notify a script of the running emulator or rom to set an LCD screen for example.
https://github.com/sselph/rp-tool/releases
The script works by parsing the es_systems.cfg file and watching the running processes to find the emulator then parsing out the rom info out of the gamelist.xml.
You can run it in 2 different modes, or you can do both:
-web
this will start a web server at http://<retropie ip>:8080/status that prints text in json format of the running emulator and game.
-script <full path to script>
this will run the script with a set of arguments <operation> <system short name> <system long name> <game title>
I also included an init file if you want to run it on boot. You just have to edit this line with the flags you prefer and install it.
https://github.com/sselph/rp-tool/blob/master/rw/cmd/romwatch/romwatch.init#L27
$ sudo cp romwatch.init /etc/init.d/
$ sudo update-rc.d romwatch defaults
$ sudo /etc/init.d/romwatch start