site  contact  subhomenews

GUI creation for the Linux framebuffer

August 17, 2018 — BarryK

For a long time I have wanted some means of creating very small GUI apps that are statically compiled and work directly with the Linux framebuffer. The use would be for a GUI app in the initramfs.

I recently discovered LittlevGL, and then decided to ask for the opinion of two guys who are real experts in this field, 'technosaurus' and 'goingnuts' (their Puppy Forum names).

Firstly, here is a post about LittlevGL:

I sent a pm on the Puppy Forum to technosaurus, and he responded:

littlevgl has been on my radar for a while now - I do like it, but its no gtkdialog replacement; you can see more of my projects of interest at I am in the process of moving from near Houston, Texas to near Kansas City, Missouri (U.S.) We have moved 3 times in 3 years so I have not been coding for some time - just reading/analyzing code for future use (thus all the starred projects, but few commits)

Besides littlevgl, the ones I know of that will work for the framebuffer (and X) are: forum thread here + oui/blendish (uses SDL) (lacks widgets)

more gtkdialog-like: some largish dependencies (libpng,libjpeg,
libxml2,freetype,fontconfig) possibly unmaintained and needs freetype and lua - uses any raw framebuffer (or X11 depending on configuration)

Some notes.

For the ones that use opengl (or GLES) a specially built Mesa is needed and some framebuffer drivers are not supported because they lack support for kernel mode setting (unfortunately no one has ported Fabrice Bellard's tinygl as a fallback)

littlevgl seems to be a retained mode GUI like gtk and kde (but seems to be simplified so that you need ~1/3 less code than gtk and without the huge overhead of c++ and qt) There is a template here and it seems to be targeted to Linux with growing driver support
nuklear and nanovg are immediate mode GUIs which cater toward game development and tend to use more CPU, though nuklear appears to have addressed this since I last tested it. However, since they are single header files, anything unused will get compiled out so they make small binaries.

GUIslice could be a good compromise since it uses SDL (1.2 or 2.x) which will handle the framebuffer (or X) for you. It isn't as pretty though - basically an improvement on curses.

I was aware of Nuklear, and did look at it briefly a year or so ago.

Here is another one, uGFX:

This is a commercial product, free for "home, hobby and educational" use. It is an open source project, and will work with sdl or directly with the framebuffer. Git project site: 

Tags: linux