I've long wanted a way to add individual games to the GMenu2x home screen, so that I can select and jump directly into my favorite emulated titles without having to first launch an emulator, scroll through a roms list, and choose the rom I am looking for.
I finally realized that at least in some cases, I could use a shell script and the opkrun command to achieve this. I thought I'd share what I did in case someone has any ideas on how I could improve the process.
I've just created a quick one-liner shell script on my Zero that looks like this:
opkrun /media/data/apps/PocketSNES-20140821.opk /media/data/local/home/roms/SNES/Earthbound.smc
and then used the standard gmenu2x controls to add a home screen section and add a short cut to that script. When I run it it launches directly in to the game.
So far I have only had success with this with SNES roms. I also tried it with FCEUX for NES games, and while I can run the shell script from telnet with gmenu2x disabled and it works fine, if I run it from a gmenu2x homescreen shortcut it seems to crash on launch. I haven't tried with any other emulators yet.Edit:
My shell script and linux knowledge is pretty minimal, so I hoped that perhaps someone else here would be able to improve on this idea. Eventually I'd love to see a system-wide standardized way to add rom links to the home screen, but I'd imageine that's a non-trivial feature addition for gmenu2x.
This should work with any emulator that either uses the gMenu2x file selector or accepts roms as command line arguments. If an emulator uses its own file browser it may or may not work with this method. For example, ohBoy can not launch roms in this way.