Current situation: a simple imageviewer in a loop. I'm displaying still images by using the framebuffer via fbi. I generate the list of images by a simple script right before firing it up. It runs in an infinite loop. To stop the slideshow, my script fetches the pid of fbi and kills the process.
Now I'd like to have some extra functionality by implementing a physical 'PREV' and 'NEXT' button, attached to the GPIO pins.
The most simple approach will be to launch a seperate process listening to those 2 buttons, kill the fbi process at press, re-write the imagelist and restart fbi. While this is easy to design, something tells me there must be a better, cleaner approach.
I assume I could modify the fbi source and implement the functionality right into it. This will take an awfull lot more effort though as my coding skills might not suffice to bring this approach to a good end.
What other approaches are possible?