buffybox/README.md

51 lines
2.3 KiB
Markdown
Raw Normal View History

2021-09-12 14:51:07 +02:00
# squeek2lvgl
squeek2lvgl is a Python script that makes it possible to use [squeekboard] keyboard layouts with [LVGL]'s keyboard widget. To achieve this, [squeekboard]'s YAML syntax for layout definitions is converted into a C file (with an accompanying header) that can then be added to an [LVGL] project.
To access [squeekboard]'s layout files, squeek2lvgl shallowly clones the [squeekboard] git repository into a temporary directory and purges it before exiting.
## Usage
First, set up the virtual Python environment and install the dependencies with
```
$ pipenv install
```
Afterwards you can execute the script with `pipenv run`. Use the `-h` / `--help` flag to print detailed usage instructions.
```
$ pipenv run python squeek2lvgl.py --help
usage: squeek2lvgl.py [-h] --input INPUT [--surround-space-with-arrows] [--generate-scancodes] --output OUTPUT
2021-09-12 14:51:07 +02:00
Convert squeekboard layouts to LVGL-compatible C code.
optional arguments:
-h, --help show this help message and exit
--input INPUT squeekboard layout to use as input for generation. Has to be a YAML file path relative to data/keyboards. Can be specified
multiple times.
--surround-space-with-arrows
insert left / right arrow before / after space key
2021-09-12 14:55:43 +02:00
--generate-scancodes also generate scancode tables (only works for US layout currently)
2021-09-12 14:51:07 +02:00
--output OUTPUT output directory for generated files
```
2021-09-12 14:54:52 +02:00
As an example, the following command converts [squeekboard's US layout] to C
2021-09-12 14:51:07 +02:00
```
$ pipenv run python squeek2lvgl.py --input us.yaml --output .
```
When the process has finished, `sq2lv_layouts.h` and `sq2lv_layouts.c` will have been written into the current directory. Check the [examples] folder for further details about the generated files.
## License
2021-09-12 14:53:45 +02:00
squeek2lvgl 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.
2021-09-12 14:51:07 +02:00
[squeekboard] and its keyboard layouts are licensed under the GNU General Public License version 3.0.
[LVGL]: https://github.com/lvgl/lvgl
[squeekboard]: https://gitlab.gnome.org/World/Phosh/squeekboard
2021-09-12 14:54:52 +02:00
[squeekboard's US layout]: https://gitlab.gnome.org/World/Phosh/squeekboard/-/blob/master/data/keyboards/us.yaml
2021-09-12 14:51:07 +02:00
[examples]: ./examples