buffybox/buffyboard/README.md

153 lines
6.5 KiB
Markdown
Raw Normal View History

2021-09-13 13:30:15 +02:00
Buffyboard
==========
2021-09-21 21:39:51 +02:00
Touch-enabled framebuffer keyboard (not only) for vampire slayers.
[[_TOC_]]
# About
2021-09-17 15:36:31 +02:00
Buffyboard is a touch-enabled on-screen keyboard running on the Linux framebuffer. It's primarily intended for vampire hunting[^1] but you can also use it as a general purpose keyboard.
2021-09-13 13:30:15 +02:00
2021-09-21 21:41:38 +02:00
Buffyboard uses [LVGL] for input processing and rendering. Key events are forwarded directly to the kernel via a uinput device. Since the latter emulates a hardware keyboard, the terminal keymap must match with buffyboard's layout or else on-screen keys might not produce the correct result.
2021-09-13 13:30:15 +02:00
# Status
2021-09-21 21:39:51 +02:00
We are en route to v1 which aims at providing a useable, visually pleasant application including [fbkeyboard]'s most essential features. For details about the current status, see the [v1 milestone]. You may also browse the full list of [open issues] to get an idea of what's planned beyond v1.
2021-09-13 13:30:15 +02:00
2021-09-21 21:39:51 +02:00
Here are a few highlights of what already works:
2021-09-13 13:30:15 +02:00
- On-screen keyboard control via mouse, trackpad or touchscreen
- Multi-layer keyboard layout including lowercase letters, uppercase letters, numbers and selected symbols (based on top three layers of [squeekboard's US terminal layout])
- Key chords with one or more modifiers terminated by a single non-modifier (e.g. `CTRL-c`)
- Highlighting of active modifiers
- Automatic resizing (and later reset) of active VT to prevent overlap with keyboard
2024-03-30 08:34:13 +01:00
- Theming support
2021-09-13 13:30:15 +02:00
2024-03-30 12:46:09 +00:00
Screenshots of the currently available themes may be found in the [screenshots] folder.
<img src="screenshots/breezy-light-540x960.png" alt="540x960" height="300"/>
<img src="screenshots/breezy-dark-540x960.png" alt="540x960" height="300"/>
<br>
<img src="screenshots/pmos-light-800x480.png" alt="800x480" height="300"/>
<img src="screenshots/pmos-dark-800x480.png" alt="800x480" height="300"/>
2024-03-30 08:34:13 +01:00
# Usage
You can get an overview of available command line options by running it with the `-h` or `--help` argument.
```
$ buffyboard --help
Usage: buffyboard [OPTION]
Mandatory arguments to long options are mandatory for short options too.
2024-03-30 12:46:09 +00:00
-C, --config-override Path to a config override file. Can be supplied
multiple times. Config files are merged in the
following order:
* /etc/buffyboard.conf
* /etc/buffyboard.conf.d/* (alphabetically)
* Override files (in supplied order)
-g, --geometry=NxM[@X,Y] Force a display size of N horizontal times M
vertical pixels, offset horizontally by X
pixels and vertically by Y pixels
-d --dpi=N Override the display's DPI value
-r, --rotate=[0-3] Rotate the UI to the given orientation. The
values match the ones provided by the kernel in
/sys/class/graphics/fbcon/rotate.
* 0 - normal orientation (0 degree)
* 1 - clockwise orientation (90 degrees)
* 2 - upside down orientation (180 degrees)
* 3 - counterclockwise orientation (270 degrees)
-h, --help Print this message and exit
2024-04-01 16:21:44 +02:00
-v, --verbose Enable more detailed logging output on STDERR
2024-03-30 12:46:09 +00:00
-V, --version Print the buffyboard version and exit
2024-03-30 08:34:13 +01:00
```
For an example configuration file, see [buffyboard.conf].
2021-09-21 21:56:37 +02:00
2021-09-13 13:30:15 +02:00
# Development
## Dependencies
- [inih]
2021-09-13 13:30:15 +02:00
- [lvgl] (git submodule / linked statically)
2021-09-21 21:39:51 +02:00
- [squeek2lvgl] (git submodule / linked statically)
2021-09-13 13:30:15 +02:00
- [libinput]
2024-03-28 14:31:27 +01:00
- [libudev]
2021-09-13 13:30:15 +02:00
- evdev kernel module
- uinput kernel module
## Building & running
Some of buffyboard's dependencies are included as git submodules in this repository. You can clone the repository and initialise the submodules with
```
$ git clone https://gitlab.com/cherrypicker/buffyboard.git
2022-10-01 21:26:13 +02:00
$ cd buffyboard
$ git submodule init
$ git submodule update
```
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.
2021-09-13 13:30:15 +02:00
```
2021-09-23 14:42:48 +02:00
$ meson _build
2021-09-23 14:46:27 +02:00
$ meson compile -C _build
2021-09-13 13:30:15 +02:00
$ sudo chvt 2
2021-09-23 14:42:48 +02:00
$ sudo ./_build/buffyboard
2021-09-13 13:30:15 +02:00
```
2021-09-23 14:46:27 +02:00
With meson <0.55 use `ninja` instead of `meson compile`.
2021-09-21 21:39:51 +02:00
## Keyboard layouts
2021-09-13 13:30:15 +02:00
Buffyboard 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
```
## Generating screenshots
To generate screenshots in a variety of common sizes, install [fbcat], build buffyboard and then run
```
$ sudo ./regenerate-screenshots _build/buffyboard
```
where `_build/buffyboard` is the location of the buffyboard binary.
2021-09-13 13:30:15 +02:00
# Acknowledgements
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].
2021-09-21 21:39:51 +02:00
Buffyboard was inspired by [fbkeyboard].
2021-09-13 13:30:15 +02:00
2021-09-17 15:42:36 +02:00
# Footnotes
2021-09-17 15:45:19 +02:00
[^1]: If you still don't know what vampires have to do with all of this, the train of thought is: Linux frame**buffer** 👉 **buffy**board 👉 ... wait for it ... 👉 [**Buffy** the Vampire Slayer]. There you have it. I never claimed I was funny. 😅
2021-09-17 15:32:49 +02:00
2021-09-17 15:45:19 +02:00
[**Buffy** the Vampire Slayer]: https://en.wikipedia.org/wiki/Buffy_the_Vampire_Slayer
2021-09-21 21:39:51 +02:00
[LVGL]: https://lvgl.io
[arrow-alt-circle-up]: https://fontawesome.com/v5.15/icons/arrow-alt-circle-up?style=solid
2024-03-30 08:34:13 +01:00
[buffyboard.conf]: ./buffyboard.conf
[fbcat]: https://github.com/jwilk/fbcat
2021-09-21 21:39:51 +02:00
[fbkeyboard]: https://github.com/bakonyiferenc/fbkeyboard
[inih]: https://github.com/benhoyt/inih
2021-09-21 21:39:51 +02:00
[libinput]: https://gitlab.freedesktop.org/libinput/libinput
2024-03-28 14:31:27 +01:00
[libudev]: https://github.com/systemd/systemd/tree/main/src/libudev
2021-09-21 21:39:51 +02:00
[lv_port_linux_frame_buffer]: https://github.com/lvgl/lv_port_linux_frame_buffer
[lv_sim_emscripten]: https://github.com/lvgl/lv_sim_emscripten/blob/master/mouse_cursor_icon.c
2021-09-13 13:30:15 +02:00
[lvgl]: https://github.com/lvgl/lvgl
2021-09-21 21:39:51 +02:00
[open issues]: https://gitlab.com/cherrypicker/buffyboard/-/issues
2024-03-30 12:46:09 +00:00
[screenshots]: ./screenshots
2021-09-13 13:30:15 +02:00
[squeek2lvgl]: https://gitlab.com/cherrypicker/squeek2lvgl]
2021-09-21 21:39:51 +02:00
[squeekboard layouts]: https://gitlab.gnome.org/World/Phosh/squeekboard/-/blob/master/data/keyboards
[squeekboard's US terminal layout]: https://gitlab.gnome.org/World/Phosh/squeekboard/-/blob/master/data/keyboards/terminal/us.yaml
2021-09-13 13:30:15 +02:00
[squeekboard]: https://gitlab.gnome.org/World/Phosh/squeekboard/-/tree/master
2021-09-21 21:39:51 +02:00
[v1 milestone]: https://gitlab.com/cherrypicker/buffyboard/-/milestones/1