I wrote two little tools and hope they might be useful for some people here.
The idea behind
kobomenu is to let bash scripts interact with the user.
Example code:
Code:
mychoice=$(kobomenu Coffee Tea Cocoa)
The user will be presented with a list of the options Coffee, Tea, Cocoa, and EXIT to choose from. The variable mychoice will be set to the selected value. For how it looks, cf. kbmenu_001.jpg and kbmenu_003.jpg of post 2.
kbmessage can be used to display some text and offers zoom in and out.
Example code:
Code:
kbmessage 'Hello world!'
Example code:
Code:
kbmessage -f /mnt/onboard/mytext.txt
Example code:
Code:
choice=$(kobomenu Coffee Tea Cocoa)
if [ "$choice" != "EXIT" ]; then
kbmessage "Your choice was $choice"
fi
For how it looks, cf. kbmenu_003.jpg of post 2.
kobomenu and
kbmessage are depending on libraries and drivers provided by Sergey with his KoboLauncher.
If you call your script from the KoboLauncher the necessary environment variables are already exported.
If you call your script from a Qt neutral context you have to export the variables yourself and add the argument -qws when calling
kobomenu or
kbmessage. You can take KoboLauncher.sh as a model, or kobosubmenu.sh of kbmenuOnStart.zip of post 2.
I would like to thank Sergey for providing the drivers.