Scripts like a game with a gamepad (GPi case)

Dear Libretro community, Im starting a project with the idea to be able to launch linux scripts from RetroArch. We can use Lakka, Retropie or any other one if allow us to do it (from Retropie i was able to launch the /bin/bash and open a terminal, but cannot write anything because no keyoard, only gamepad) The idea can be to use something similar to the Retroarch menu or something like dialog or whiptail. In a future we can have an own GUI. Also thinking on this, it can be possible to use Linux games, and in this scenario to have an specific emulator for this. There is no already any Linux games emulator?

The project is mainly focussed on Gpi case but also for similar usage with any gamepad.

Thanks

Take a look at the dolphin-launcher core, which just launches an outside process. I had thought to extend it to be more portable and launch scripts, etc. before but never got very far.