|Version 1 (modified by kevin, 3 years ago)|
Note: this is a first attempt. There will be bugs.
fbmenu is a menu-selection utility for the Archos A5, intended to be used within init scripts for user selections. It draws directly on the framebuffer, and takes input from the volume and power buttons. It is broadly similar in operation to Archos' proprietary AUI utility and, for ease of integration, takes the same command-line switches and produces the same output. However, only the -c select' and -c message' modes of AUI are supported at present.
Unlike AUI, fbmenu does not operate a client-daemon model. It starts up, the user can select something, and then it stops. Advantages over AUI include
- It is (arguably) slightly less ugly
- It uses only a quarter the disk space
- It starts up quicker, because there is no daemon to wait for
- It can be configured to select a default after a timeout
- It allows the unit to power off if left idle at the menu
fbmenu needs a bitmap font, which it expects to find at /usr/lib/consolefont.psf. A suitable font is included in the source package. Other than that, configuration consists of invoking it with the correct arguments.
Here is an example:
#/bin/sh ... SEL=`fbmenu -T "boot menu" -t "Select an OS to load" -t "Angstrom" \ -c select -t "Ubuntu" -o 10 -d 1`
fbmenu will not exit until the user selects something or the timeout is reached. The -o 10 switch gives a 10-second timeout for the default (-d 1) is selected automatically.
fbmenu does not do anything with the user's selection, nor does it generate any display itself. It is up to the calling script to build an appropriate menu amd interpret the output.
For compatibility with AUI, the output (which goes to stdout) is of the form
where N is the item selected. THere is no end-of-line. Also for compatibility with AUI, you can retrieve the last selection by doing
You can add as many -t something switches as the screen will fit (actually, you can add more but you won't see them). With the supplied font, that's about 12 items. For compatibility with AUI the first -t is a subtitle, not a selectable item.
If you want to change the appearance, edit the source and rebuild :)
fbmenu is intended to be built statically linked against uLibc. Using the Angstrom glibc-based toolchain will result in an executable larger that the Archos flash size :/ The uClibc toolchain from the Archos open-source bundle is a better bet.
Note that fbmenu blanks the framebuffer on exit, so there may be a `blank screen' moment before the next thing happens.
On the Archos A5, you may need to disable the framebuffer alpha channel, as fbmenu has no alpha support. Do this as follows:
# echo "8" > /sys/devices/system/display/gfxformat
fbmenu needs to be able to open /dev/input/event0 and /dev/input/event1. These are probably root-owned, so you'll need to run fbmenu as root, or fiddle with the permissions.
fbmenu makes use of an open-source library `libFB' for handling text output on the framebuffer.