Unl0kr is an [osk-sdl] clone written in [LVGL] and rendering directly to the Linux framebuffer. As a result, it doesn't depend on GPU hardware acceleration.
For some background on how unl0kr came to be, see postmarketOS/osk-sdl#121.
While we continue to tweak and extend Unl0kr, it is deemed fully functional. Unl0kr has been set up as the default disk unlocker on [postmarketOS][package-pmos] and was also packaged for other distrubtions including [Arch Linux][package-arch] and [Debian][package-debian].
When pulling changes from the remote later, either use `git pull --recurse-submodules` or manually run `git submodule update` as needed after pulling.
Once you have the sources, you can build the app and run it in a VT. Unless your user account has special privileges, `sudo` will be needed to access input device files.
```
$ meson _build
$ meson compile -C _build
$ sudo chvt 2
$ sudo ./_build/unl0kr
```
With meson <0\.55use`ninja`insteadof`meson compile`\.
## Valgrind
> Using C without Valgrind is like skydiving without a parachute.
To be able to use Valgrind, add `default_options: ['optimization=g']` in the `project` section of `meson.build` and rebuild. Afterwards you can run the application with Valgrind's leaks check enabled via
```
sudo valgrind --leak-check=yes ./_build/unl0kr
```
## Backends
Unl0kr supports multiple LVGL display drivers, referred to as "backends".
- fbdev
- drm (optional)
The active backend can be selected via the `general.backend` option in the configuration file.
Note that if [libdrm] is installed, the DRM backend will be compiled in automatically. It's possible to prevent this behaviour by passing the `with-drm` option to meson.
```
$ meson _build -Dwith-drm=disabled
```
## Keyboard layouts
Unl0kr uses [squeekboard layouts] converted to C via [squeek2lvgl]. To regenerate the layouts, ensure that you have pipenv installed (e.g. via `pip install --user pipenv`) and then run
```
$ ./regenerate-layouts.sh
```
from the root of the repository.
## Generating screenshots
To generate screenshots in a variety of common sizes, build unl0kr and then run
```
$ sudo ./regenerate-screenshots _build/unl0kr
```
where `_build/unl0kr` is the location of the unl0kr binary. Note that you may have to adapt some of the settings inside the script depending on the device you're using to generate the screenshots.
## Screen recording
For demonstration purposes you can record the framebuffer device, e.g. with ffmpeg: