This is an experiment that attempts to evaluate the fitness of [lvgl] to build a graphical user interface on the Linux framebuffer for unlocking encrypted hard drives during boot. It's neither functional nor meant to replace postmarketOS/osk-sdl. For background see postmarketOS/osk-sdl#121.
# Status
The biggest obstacle is input processing. [lv_drivers] provides an evdev interface (supporting touchscreens, pointer devices and keypads) and a [libinput] interface (supporting touchscreens only). Presently there is no support for full physical keyboards (short of using the SDL interface) and no automated device detection. Additonally, the drivers can currently not be used with multiple devices at the same time.
## What works
- Password-entry UI including on-screen keyboard on the framebuffer
- Input device discovery for keyboards, mice and trackpads
As far as feasible and sensible, [lvgl] and [lv_drivers] fixes and enhancements are being upstreamed. Ideally all code outside of `main.c` should be contributed back but I'm not yet sure if that will be possible.
Fonts need to be converted to C arrays before they can be used with [lvgl]. This is most conveniently done using the official [online font converter]. Useful unicode ranges for the conversion are 0x0020-0x007F (basic Latin), 0x00A0-0x00FF (Latin-1 supplement), 0x0100-0x017F (Latin extended A), 0x2000-0x206F (general punctuation) and 0x20A0-0x20CF (currency symbols). For the various `LV_SYMBOL_...` glyphs, make sure to also add [Font Awesome] with the following code points:
The layouts in [layouts.c] are generated from [squeekboard layouts] using the [unsqu33kr/unsqu33kr.py] script. To run the script use the following commands
```
$ cd unsqu33kr
$ pipenv install
$ pipenv run python unsqu33kr.py
```
Then copy the output into [layouts.c].
## Screen recording
For demonstration purposes you can record the framebuffer device, e.g. with ffmpeg:
The [lv_port_linux_frame_buffer] project served as a starting point for the codebase. The mouse cursor image was taken from [lv_sim_emscripten].
# License
Unl0kr is licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.