Merge branch 'master' into johannes/nord-theme

This commit is contained in:
Johannes Marbach
2024-06-03 21:06:23 +02:00
159 changed files with 666 additions and 142 deletions

View File

@@ -1,14 +1,13 @@
build-buffyboard:
build-and-test-buffyboard:
image: alpine:3.19
tags:
- saas-linux-small-amd64
script:
- apk -q add git build-base meson linux-headers inih-dev libinput-dev eudev-dev
- apk -q add git bash build-base meson linux-headers inih-dev libinput-dev eudev-dev
- git submodule init
- git submodule update
- cd buffyboard
- meson _build
- meson compile -C _build
- ./test/test-all.sh
build-and-test-unl0kr-with-drm:
image: alpine:3.19
@@ -31,3 +30,13 @@ build-and-test-unl0kr-without-drm:
- git submodule update
- cd unl0kr
- ./test/test-without-drm.sh
build-iskey:
image: alpine:3.19
tags:
- saas-linux-small-amd64
script:
- apk -q add git bash build-base meson linux-headers libevdev-dev
- cd iskey
- meson setup _build
- meson compile -C _build

View File

@@ -10,15 +10,21 @@ If a change only affects particular applications, they are listed in parentheses
## Unreleased
- feat: Add adwaita-dark theme (thanks @topjor)
- feat: Add Nord themes
## 3.1.0 (2024-04-10)
- feat(buffyboard): Handle input device connection/disconnection at runtime; adds new dependency libudev
- feat(buffyboard): Allow choosing theme via config and add all themes from unl0kr
- feat(buffyboard): Add fbdev force-refresh quirk via config
- feat(buffyboard): Allow disabling input devices via config
- feat(buffyboard): Add CLI flags for overriding geometry & DPI
- feat(buffyboard): Add CLI flag for verbose logging
- fix(unl0kr): Shutdown message box doesn't close on decline
- fix(unl0kr): Shutdown message box buttons and label are unstyled
- fix(unl0kr): Build fails when DRM is disabled
- misc: Update lvgl to git master (2023-03-30)
- misc: Update lvgl to git master (2023-04-10)
## 3.0.0 (2024-03-22)

View File

@@ -14,6 +14,8 @@ BuffyBox is a suite of graphical applications for the terminal.
**[squeek2lvgl]** Converter for transforming [Squeekboard] layouts into [LVGL]-compatible C code
**[iskey]** - A utility for checking for key presses in bash scripts.
**[shared]** Internal code that is shared by some or all applications in the suite but not meant to be used externally
## Contributing
@@ -44,6 +46,7 @@ For the license of bundled images and fonts, see [shared/cursor] and [shared/fon
[LVGL]: https://github.com/lvgl/lvgl
[shared]: ./shared
[squeek2lvgl]: ./squeek2lvgl
[iskey]: ./iskey
[Squeekboard]: https://gitlab.gnome.org/World/Phosh/squeekboard
[shared/cursor]: ./shared/cursor
[shared/fonts]: ./shared/fonts

View File

@@ -59,6 +59,7 @@ Mandatory arguments to long options are mandatory for short options too.
* 2 - upside down orientation (180 degrees)
* 3 - counterclockwise orientation (270 degrees)
-h, --help Print this message and exit
-v, --verbose Enable more detailed logging output on STDERR
-V, --version Print the buffyboard version and exit
```
@@ -108,7 +109,15 @@ Buffyboard uses [squeekboard layouts] converted to C via [squeek2lvgl]. To regen
$ ./regenerate-layouts.sh
```
from the root of the repository.
## 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.
# Acknowledgements
@@ -126,6 +135,7 @@ Buffyboard was inspired by [fbkeyboard].
[LVGL]: https://lvgl.io
[arrow-alt-circle-up]: https://fontawesome.com/v5.15/icons/arrow-alt-circle-up?style=solid
[buffyboard.conf]: ./buffyboard.conf
[fbcat]: https://github.com/jwilk/fbcat
[fbkeyboard]: https://github.com/bakonyiferenc/fbkeyboard
[inih]: https://github.com/benhoyt/inih
[libinput]: https://gitlab.freedesktop.org/libinput/libinput

View File

@@ -45,6 +45,7 @@ static void init_opts(bb_cli_opts *opts) {
opts->y_offset = 0;
opts->dpi = 0;
opts->rotation = LV_DISPLAY_ROTATION_0;
opts->verbose = false;
}
static void print_usage() {
@@ -71,6 +72,7 @@ static void print_usage() {
" * 2 - upside down orientation (180 degrees)\n"
" * 3 - counterclockwise orientation (270 degrees)\n"
" -h, --help Print this message and exit\n"
" -v, --verbose Enable more detailed logging output on STDERR\n"
" -V, --version Print the buffyboard version and exit\n");
/*-------------------------------- 78 CHARS --------------------------------*/
}
@@ -89,13 +91,14 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) {
{ "dpi", required_argument, NULL, 'd' },
{ "rotate", required_argument, NULL, 'r' },
{ "help", no_argument, NULL, 'h' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
int opt, index = 0;
while ((opt = getopt_long(argc, argv, "C:g:d:r:hV", long_opts, &index)) != -1) {
while ((opt = getopt_long(argc, argv, "C:g:d:r:hvV", long_opts, &index)) != -1) {
switch (opt) {
case 'C':
opts->config_files = realloc(opts->config_files, (opts->num_config_files + 1) * sizeof(char *));
@@ -145,6 +148,9 @@ void bb_cli_parse_opts(int argc, char *argv[], bb_cli_opts *opts) {
case 'h':
print_usage();
exit(EXIT_SUCCESS);
case 'v':
opts->verbose = true;
break;
case 'V':
fprintf(stderr, "buffyboard %s\n", BB_VERSION);
exit(0);

View File

@@ -29,6 +29,8 @@ typedef struct {
int dpi;
/* Display rotation */
lv_display_rotation_t rotation;
/* Verbose mode. If true, provide more detailed logging output on STDERR. */
bool verbose;
} bb_cli_opts;
/**

View File

@@ -14,6 +14,7 @@
#include "lvgl/lvgl.h"
#include "../shared/indev.h"
#include "../shared/log.h"
#include "../shared/theme.h"
#include "../shared/themes.h"
#include "../squeek2lvgl/sq2lv.h"
@@ -180,6 +181,11 @@ int main(int argc, char *argv[]) {
/* Parse command line options */
bb_cli_parse_opts(argc, argv, &cli_opts);
/* Set up log level */
if (cli_opts.verbose) {
bbx_log_set_level(BBX_LOG_LEVEL_VERBOSE);
}
/* Parse config files */
bb_config_init_opts(&conf_opts);
bb_config_parse_file("/etc/buffyboard.conf", &conf_opts);

View File

@@ -5,7 +5,7 @@
project(
'buffyboard',
'c',
version: '3.0.0',
version: '3.1.0',
default_options: 'warning_level=1',
meson_version: '>=0.53.0'
)

View File

@@ -7,14 +7,8 @@ executable=$1
outdir=screenshots
config=buffyboard-screenshots.conf
themes=(
breezy-light
breezy-dark
pmos-light
pmos-dark
nord-light
nord-dark
)
root=$(git rev-parse --show-toplevel)
themes_c=$root/shared/themes.c
resolutions=(
# Nokia N900
@@ -34,6 +28,11 @@ resolutions=(
1920x1080
)
if ! which fbcat > /dev/null 2>&1; then
echo "Error: Could not find fbcat" 1>&2
exit 1
fi
if [[ ! -f $executable || ! -x $executable ]]; then
echo "Error: Could not find executable at $executable" 1>&2
exit 1
@@ -63,7 +62,7 @@ readme="# Buffyboard themes"$'\n'
clear # Blank the screen
for theme in ${themes[@]}; do
while read -r theme; do
write_config $theme
readme="$readme"$'\n'"## $theme"$'\n\n'
@@ -74,8 +73,11 @@ for theme in ${themes[@]}; do
sleep 3 # Wait for UI to render
../../fbcat/fbcat /dev/fb0 > "$outdir/$theme-$res.ppm"
convert -size $fb_res \
fbcat /dev/fb0 > "$outdir/$theme-$res.ppm"
kill -15 $pid
convert \
-size $fb_res \
$outdir/$theme-$res.ppm \
screenshot-background.png \
-crop $res+0+0 \
@@ -84,12 +86,11 @@ for theme in ${themes[@]}; do
"$outdir/$theme-$res.png"
rm "$outdir/$theme-$res.ppm"
kill -15 $pid
readme="$readme<img src=\"$theme-$res.png\" alt=\"$res\" height=\"300\"/>"$'\n'
sleep 1 # Delay to prevent terminal mode set / reset interference
done
done
done < <(grep "name =" "$themes_c" | grep -o '".*"' | tr -d '"' | sort)
echo -n "$readme" > "$outdir/README.md"

View File

@@ -1,16 +1,16 @@
# Buffyboard themes
## breezy-light
## adwaita-dark
<img src="breezy-light-480x800.png" alt="480x800" height="300"/>
<img src="breezy-light-800x480.png" alt="800x480" height="300"/>
<img src="breezy-light-540x960.png" alt="540x960" height="300"/>
<img src="breezy-light-960x540.png" alt="960x540" height="300"/>
<img src="breezy-light-768x1024.png" alt="768x1024" height="300"/>
<img src="breezy-light-1024x768.png" alt="1024x768" height="300"/>
<img src="breezy-light-1280x800.png" alt="1280x800" height="300"/>
<img src="breezy-light-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-light-1920x1080.png" alt="1920x1080" height="300"/>
<img src="adwaita-dark-480x800.png" alt="480x800" height="300"/>
<img src="adwaita-dark-800x480.png" alt="800x480" height="300"/>
<img src="adwaita-dark-540x960.png" alt="540x960" height="300"/>
<img src="adwaita-dark-960x540.png" alt="960x540" height="300"/>
<img src="adwaita-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="adwaita-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="adwaita-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="adwaita-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="adwaita-dark-1920x1080.png" alt="1920x1080" height="300"/>
## breezy-dark
@@ -24,29 +24,29 @@
<img src="breezy-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-dark-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-light
## breezy-light
<img src="pmos-light-480x800.png" alt="480x800" height="300"/>
<img src="pmos-light-800x480.png" alt="800x480" height="300"/>
<img src="pmos-light-540x960.png" alt="540x960" height="300"/>
<img src="pmos-light-960x540.png" alt="960x540" height="300"/>
<img src="pmos-light-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-light-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-light-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-light-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-light-1920x1080.png" alt="1920x1080" height="300"/>
<img src="breezy-light-480x800.png" alt="480x800" height="300"/>
<img src="breezy-light-800x480.png" alt="800x480" height="300"/>
<img src="breezy-light-540x960.png" alt="540x960" height="300"/>
<img src="breezy-light-960x540.png" alt="960x540" height="300"/>
<img src="breezy-light-768x1024.png" alt="768x1024" height="300"/>
<img src="breezy-light-1024x768.png" alt="1024x768" height="300"/>
<img src="breezy-light-1280x800.png" alt="1280x800" height="300"/>
<img src="breezy-light-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-light-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-dark
## nord-dark
<img src="pmos-dark-480x800.png" alt="480x800" height="300"/>
<img src="pmos-dark-800x480.png" alt="800x480" height="300"/>
<img src="pmos-dark-540x960.png" alt="540x960" height="300"/>
<img src="pmos-dark-960x540.png" alt="960x540" height="300"/>
<img src="pmos-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-dark-1920x1080.png" alt="1920x1080" height="300"/>
<img src="nord-dark-480x800.png" alt="480x800" height="300"/>
<img src="nord-dark-800x480.png" alt="800x480" height="300"/>
<img src="nord-dark-540x960.png" alt="540x960" height="300"/>
<img src="nord-dark-960x540.png" alt="960x540" height="300"/>
<img src="nord-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="nord-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="nord-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="nord-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="nord-dark-1920x1080.png" alt="1920x1080" height="300"/>
## nord-light
@@ -60,14 +60,26 @@
<img src="nord-light-1440x720.png" alt="1440x720" height="300"/>
<img src="nord-light-1920x1080.png" alt="1920x1080" height="300"/>
## nord-dark
## pmos-dark
<img src="nord-dark-480x800.png" alt="480x800" height="300"/>
<img src="nord-dark-800x480.png" alt="800x480" height="300"/>
<img src="nord-dark-540x960.png" alt="540x960" height="300"/>
<img src="nord-dark-960x540.png" alt="960x540" height="300"/>
<img src="nord-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="nord-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="nord-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="nord-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="nord-dark-1920x1080.png" alt="1920x1080" height="300"/>
<img src="pmos-dark-480x800.png" alt="480x800" height="300"/>
<img src="pmos-dark-800x480.png" alt="800x480" height="300"/>
<img src="pmos-dark-540x960.png" alt="540x960" height="300"/>
<img src="pmos-dark-960x540.png" alt="960x540" height="300"/>
<img src="pmos-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-dark-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-light
<img src="pmos-light-480x800.png" alt="480x800" height="300"/>
<img src="pmos-light-800x480.png" alt="800x480" height="300"/>
<img src="pmos-light-540x960.png" alt="540x960" height="300"/>
<img src="pmos-light-960x540.png" alt="960x540" height="300"/>
<img src="pmos-light-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-light-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-light-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-light-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-light-1920x1080.png" alt="1920x1080" height="300"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

5
buffyboard/test/build.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
rm -rf _build
meson _build
meson compile -C _build

View File

@@ -0,0 +1,25 @@
#!/bin/bash
source "$(dirname "${BASH_SOURCE[0]}")/../../test/helpers.sh"
function run_buffyboard_async() {
local log=$1
local conf=$2
./_build/buffyboard -v -C "$conf" > "$log" 2>&1 &
pid=$!
sleep 3
kill -9 $pid
wait $pid > /dev/null 2>&1
}
function run_buffyboard_sync() {
local log=$1
shift
local conf=$2
shift
local args=$@
./_build/buffyboard -v -C "$conf" $@ > "$log" 2>&1
}

8
buffyboard/test/test-all.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
run_script "$root/build.sh"
run_script "$root/test-version-matches-meson-and-changelog.sh"

View File

@@ -0,0 +1,37 @@
#!/bin/bash
log=tmp.log
root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
function clean_up() {
rm -f "$log"
}
trap clean_up EXIT
info "Querying version from build.meson"
meson_version=$(read_version_from_meson)
info "Querying version from CHANGELOG.md"
changelog_version=$(read_version_from_changelog)
info "Verifying versions"
if [[ "$meson_version" != "$changelog_version" ]]; then
error "Version $meson_version from meson.build doesn't match version $changelog_version from CHANGELOG.md"
exit 1
fi
info "Running buffyboard"
run_buffyboard_sync "$log" "$conf" -V
info "Verifying output"
if ! grep "buffyboard $meson_version" "$log"; then
error "Expected version $meson_version"
cat "$log"
exit 1
fi
ok

7
iskey/README.md Normal file
View File

@@ -0,0 +1,7 @@
# iskey
A tiny utility for determining if a key is pressed.
iskey is intended to be used in the context of a constrained environment like
the initramfs, it allows for easily scripting things like "is the user holding
volume down" which are generally non-trivial to check for in a shell script.

128
iskey/iskey.c Normal file
View File

@@ -0,0 +1,128 @@
// SPDX-License-Identifier: GPL-3.0-or-later
#include <dirent.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <libevdev/libevdev.h>
#define MAX_KEYS 32
static int codes[MAX_KEYS] = { 0 };
static unsigned int types[MAX_KEYS] = { 0 };
static int debug = 0;
static int print_key = 0;
#define log(fmt, ...) \
do { \
if (debug) \
fprintf(stderr, fmt, ##__VA_ARGS__); \
} while (0)
#define INPUT_DIR "/dev/input/"
int usage(const char *name)
{
fprintf(stderr, "Usage: %s [-d] [-s] key1...\n", name);
fprintf(stderr, " -d: debug mode\n");
fprintf(stderr, " -s: print the name of the key\n");
fprintf(stderr, "\n");
fprintf(stderr, " Check if any input device has the specified keys pressed\n"
" and exit with code 0 if so, otherwise exit with code 1\n");
return 1;
}
/* Check if any of the input devices have a non-zero value for any of the keys.
* if so then return 0, otherwise return -1.
*/
int check_for_keys(struct libevdev *dev)
{
int i;
for (i = 0; i < MAX_KEYS; i++) {
if (codes[i] == 0)
break;
if (!libevdev_has_event_code(dev, types[i], codes[i]))
continue;
if (libevdev_get_event_value(dev, types[i], codes[i])) {
if (print_key)
printf("%s\n", libevdev_event_code_get_name(types[i], codes[i]));
return 0;
}
}
return -1;
}
int main(int argc, char *argv[])
{
struct libevdev *dev;
struct dirent *dir;
DIR *d;
int i = 0, opt, fd;
char path[64] = { 0 };
/* getopt */
while ((opt = getopt(argc, argv, "d")) != -1) {
switch (opt) {
case 'd':
debug = 1;
break;
case 's':
print_key = 1;
break;
default:
return usage(argv[0]);
}
}
for (; optind < argc && i < MAX_KEYS; optind++) {
codes[i] = libevdev_event_code_from_code_name(argv[optind]);
if (codes[i] == -1) {
fprintf(stderr, "Unknown key %s\n", argv[optind]);
return 1;
}
types[i++] = libevdev_event_type_from_code_name(argv[optind]);
log("Checking for %s %s (%d)\n", libevdev_event_type_get_name(types[i-1]), argv[optind], codes[i-1]);
}
d = opendir(INPUT_DIR);
if (!d) {
perror("couldn't open /dev/input/");
return 1;
}
/* Walk through the entries in /dev/input */
while ((dir = readdir(d)) != NULL) {
memset(path, 0, sizeof(path));
i = snprintf(path, sizeof(path), "%s%s", INPUT_DIR, dir->d_name);
if (i < 0 || i >= sizeof(path)) {
printf("Path '%s' too long\n", dir->d_name);
return 1;
}
if (dir->d_type != DT_CHR || strncmp("event", dir->d_name, 5) != 0)
continue;
fd = open(path, O_RDONLY|O_NONBLOCK);
if (fd < 0) {
log("couldn't open device %s\n", dir->d_name);
continue;
}
fd = libevdev_new_from_fd(fd, &dev);
if (fd < 0) {
log("couldn't init libevdev for %s: %s\n", dir->d_name, strerror(-fd));
continue;
}
log("Checking device %s\n", libevdev_get_name(dev));
if (!check_for_keys(dev)) {
close(fd);
return 0;
}
close(fd);
}
closedir(d);
return 1;
}

7
iskey/meson.build Normal file
View File

@@ -0,0 +1,7 @@
project('iskey', 'c')
libevdev_dep = dependency('libevdev')
iskey_exe = executable('iskey',
'iskey.c',
dependencies: libevdev_dep)

2
lvgl

Submodule lvgl updated: 03498a2f83...ceadda8a46

View File

@@ -632,8 +632,161 @@ static const bbx_theme pmos_dark = {
}
};
/* Nord themes (based on https://www.nordtheme.com/docs/colors-and-palettes) */
/* Adwaita dark (based on https://gitlab.gnome.org/GNOME/libadwaita) */
static const bbx_theme adwaita_dark = {
.name = "adwaita-dark",
.window = {
.bg_color = 0x151515
},
.header = {
.bg_color = 0x242424,
.border_width = 0,
.border_color = 0x242424,
.pad = 10,
.gap = 10
},
.keyboard = {
.bg_color = 0x242424,
.border_width = 2,
.border_color = 0x242424,
.pad = 20,
.gap = 10,
.keys = {
.border_width = 1,
.corner_radius = 5,
.key_char = {
.normal = {
.fg_color = 0xDEDDDA,
.bg_color = 0x464448,
.border_color = 0x464448
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x747077,
.border_color = 0x747077
}
},
.key_non_char = {
.normal = {
.fg_color = 0xDEDDDA,
.bg_color = 0x3A3A3A,
.border_color = 0x3A3A3A
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x666666,
.border_color = 0x666666
}
},
.key_mod_act = {
.normal = {
.fg_color = 0x1E1E1E,
.bg_color = 0x747077,
.border_color = 0x747077
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x464448,
.border_color = 0x464448
}
},
.key_mod_inact = {
.normal = {
.fg_color = 0xDEDDDA,
.bg_color = 0x3A3A3A,
.border_color = 0x3A3A3A
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x3A3A3A,
.border_color = 0x3A3A3A
}
}
}
},
.button = {
.border_width = 1,
.corner_radius = 5,
.pad = 8,
.normal = {
.fg_color = 0xDEDDDA,
.bg_color = 0x3A3A3A,
.border_color = 0x3A3A3A
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x666666,
.border_color = 0x666666
}
},
.textarea = {
.fg_color = 0xDEDDDA,
.bg_color = 0x282828,
.border_width = 1,
.border_color = 0x1C71D8,
.corner_radius = 10,
.pad = 8,
.placeholder_color = 0x1C71D8,
.cursor = {
.width = 2,
.color = 0xDEDDDA,
.period = 700
}
},
.dropdown = {
.button = {
.border_width = 1,
.corner_radius = 5,
.pad = 8,
.normal = {
.fg_color = 0xDEDDDA,
.bg_color = 0x3A3A3A,
.border_color = 0x3A3A3A
},
.pressed = {
.fg_color = 0xDEDDDA,
.bg_color = 0x666666,
.border_color = 0x666666
}
},
.list = {
.fg_color = 0xDEDDDA,
.bg_color = 0x383838,
.selection_fg_color = 0xDEDDDA,
.selection_bg_color = 0x5E5E5E,
.border_width = 1,
.border_color = 0x383838,
.corner_radius = 5,
.pad = 8
}
},
.label = {
.fg_color = 0xDEDDDA,
},
.msgbox = {
.fg_color = 0xDEDDDA,
.bg_color = 0x383838,
.border_width = 1,
.border_color = 0x383838,
.corner_radius = 7,
.pad = 20,
.gap = 20,
.dimming = {
.color = 0x151515,
.opacity = 225
}
},
.bar = {
.border_width = 1,
.border_color = 0x1C71D8,
.corner_radius = 5,
.indicator = {
.bg_color = 0x1C71D8
}
}
};
/* Nord themes (based on https://www.nordtheme.com/docs/colors-and-palettes) */
#define NORD0 0x2e3440
#define NORD1 0x3b4252
#define NORD2 0x434c5e
@@ -962,14 +1115,15 @@ static const bbx_theme nord_dark = {
* Public interface
*/
const int bbx_themes_num_themes = 6;
const int bbx_themes_num_themes = 7;
const bbx_theme *bbx_themes_themes[] = {
&breezy_light,
&breezy_dark,
&pmos_light,
&pmos_dark,
&adwaita_dark,
&nord_light,
&nord_dark,
&nord_dark
};
bbx_themes_theme_id_t bbx_themes_find_theme_with_name(const char *name) {

View File

@@ -15,7 +15,10 @@ typedef enum {
BBX_THEMES_THEME_BREEZY_LIGHT = 0,
BBX_THEMES_THEME_BREEZY_DARK = 1,
BBX_THEMES_THEME_PMOS_LIGHT = 2,
BBX_THEMES_THEME_PMOS_DARK = 3
BBX_THEMES_THEME_PMOS_DARK = 3,
BBX_THEMES_THEME_ADWAITA_DARK = 4,
BBX_THEMES_THEME_NORD_LIGHT = 5,
BBX_THEMES_THEME_NORD_DARK = 6,
} bbx_themes_theme_id_t;
/* Themes */

27
test/helpers.sh Normal file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
function info() {
echo -e "[Info] $1"
}
function error() {
echo -e "\e[31m[Error]\e[0m $1"
}
function ok() {
echo -e "\e[32m[Ok]\e[0m $1"
}
function run_script() {
info "Executing $1"
"$1"
echo
}
function read_version_from_meson() {
grep "^[[:space:]]*version:" "$root/../meson.build" | head -n1 | grep -o "[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+"
}
function read_version_from_changelog() {
grep "^## [[:digit:]]" "$root/../../CHANGELOG.md" | head -n1 | grep -o "[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+"
}

View File

@@ -137,17 +137,15 @@ Unl0kr uses [squeekboard layouts] converted to C via [squeek2lvgl]. To regenerat
$ ./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
To generate screenshots in a variety of common sizes, install [fbcat], 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.
where `_build/unl0kr` is the location of the unl0kr binary.
## Screen recording
@@ -164,6 +162,7 @@ The [lv_port_linux_frame_buffer] project served as a starting point for the code
[LVGL]: https://lvgl.io
[adjust]: https://fontawesome.com/v5.15/icons/adjust?style=solid
[arrow-alt-circle-up]: https://fontawesome.com/v5.15/icons/arrow-alt-circle-up?style=solid
[fbcat]: https://github.com/jwilk/fbcat
[inih]: https://github.com/benhoyt/inih
[libinput]: https://gitlab.freedesktop.org/libinput/libinput
[libudev]: https://github.com/systemd/systemd/tree/main/src/libudev

View File

@@ -5,7 +5,7 @@
project(
'unl0kr',
'c',
version: '3.0.0',
version: '3.1.0',
default_options: 'warning_level=3',
meson_version: '>=0.53.0'
)

View File

@@ -7,14 +7,8 @@ executable=$1
outdir=screenshots
config=unl0kr-screenshots.conf
themes=(
breezy-light
breezy-dark
pmos-light
pmos-dark
nord-light
nord-dark
)
root=$(git rev-parse --show-toplevel)
themes_c=$root/shared/themes.c
resolutions=(
# Nokia N900
@@ -34,6 +28,11 @@ resolutions=(
1920x1080
)
if ! which fbcat > /dev/null 2>&1; then
echo "Error: Could not find fbcat" 1>&2
exit 1
fi
if [[ ! -f $executable || ! -x $executable ]]; then
echo "Error: Could not find executable at $executable" 1>&2
exit 1
@@ -62,18 +61,20 @@ touchscreen=false
EOF
}
function nuke_config() {
function clean_up() {
rm -f $config
}
trap "nuke_config" EXIT
trap clean_up EXIT
rm -rf "$outdir"
mkdir "$outdir"
readme="# Unl0kr themes"$'\n'
for theme in ${themes[@]}; do
clear # Blank the screen
while read -r theme; do
write_config $theme
readme="$readme"$'\n'"## $theme"$'\n\n'
@@ -84,15 +85,20 @@ for theme in ${themes[@]}; do
sleep 3 # Wait for UI to render
../../fbcat/fbcat /dev/fb0 > "$outdir/$theme-$res.ppm"
convert -size $fb_res "$outdir/$theme-$res.ppm" -crop $res+0+0 "$outdir/$theme-$res.png"
rm "$outdir/$theme-$res.ppm"
fbcat /dev/fb0 > "$outdir/$theme-$res.ppm"
kill -15 $pid
convert \
-size $fb_res \
"$outdir/$theme-$res.ppm" \
-crop $res+0+0 \
"$outdir/$theme-$res.png"
rm "$outdir/$theme-$res.ppm"
readme="$readme<img src=\"$theme-$res.png\" alt=\"$res\" height=\"300\"/>"$'\n'
sleep 1 # Delay to prevent terminal mode set / reset interference
done
done
done < <(grep "name =" "$themes_c" | grep -o '".*"' | tr -d '"' | sort)
echo -n "$readme" > "$outdir/README.md"

View File

@@ -1,16 +1,16 @@
# Unl0kr themes
## breezy-light
## adwaita-dark
<img src="breezy-light-480x800.png" alt="480x800" height="300"/>
<img src="breezy-light-800x480.png" alt="800x480" height="300"/>
<img src="breezy-light-540x960.png" alt="540x960" height="300"/>
<img src="breezy-light-960x540.png" alt="960x540" height="300"/>
<img src="breezy-light-768x1024.png" alt="768x1024" height="300"/>
<img src="breezy-light-1024x768.png" alt="1024x768" height="300"/>
<img src="breezy-light-1280x800.png" alt="1280x800" height="300"/>
<img src="breezy-light-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-light-1920x1080.png" alt="1920x1080" height="300"/>
<img src="adwaita-dark-480x800.png" alt="480x800" height="300"/>
<img src="adwaita-dark-800x480.png" alt="800x480" height="300"/>
<img src="adwaita-dark-540x960.png" alt="540x960" height="300"/>
<img src="adwaita-dark-960x540.png" alt="960x540" height="300"/>
<img src="adwaita-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="adwaita-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="adwaita-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="adwaita-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="adwaita-dark-1920x1080.png" alt="1920x1080" height="300"/>
## breezy-dark
@@ -24,17 +24,41 @@
<img src="breezy-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-dark-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-light
## breezy-light
<img src="pmos-light-480x800.png" alt="480x800" height="300"/>
<img src="pmos-light-800x480.png" alt="800x480" height="300"/>
<img src="pmos-light-540x960.png" alt="540x960" height="300"/>
<img src="pmos-light-960x540.png" alt="960x540" height="300"/>
<img src="pmos-light-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-light-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-light-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-light-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-light-1920x1080.png" alt="1920x1080" height="300"/>
<img src="breezy-light-480x800.png" alt="480x800" height="300"/>
<img src="breezy-light-800x480.png" alt="800x480" height="300"/>
<img src="breezy-light-540x960.png" alt="540x960" height="300"/>
<img src="breezy-light-960x540.png" alt="960x540" height="300"/>
<img src="breezy-light-768x1024.png" alt="768x1024" height="300"/>
<img src="breezy-light-1024x768.png" alt="1024x768" height="300"/>
<img src="breezy-light-1280x800.png" alt="1280x800" height="300"/>
<img src="breezy-light-1440x720.png" alt="1440x720" height="300"/>
<img src="breezy-light-1920x1080.png" alt="1920x1080" height="300"/>
## nord-dark
<img src="nord-dark-480x800.png" alt="480x800" height="300"/>
<img src="nord-dark-800x480.png" alt="800x480" height="300"/>
<img src="nord-dark-540x960.png" alt="540x960" height="300"/>
<img src="nord-dark-960x540.png" alt="960x540" height="300"/>
<img src="nord-dark-768x1024.png" alt="768x1024" height="300"/>
<img src="nord-dark-1024x768.png" alt="1024x768" height="300"/>
<img src="nord-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="nord-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="nord-dark-1920x1080.png" alt="1920x1080" height="300"/>
## nord-light
<img src="nord-light-480x800.png" alt="480x800" height="300"/>
<img src="nord-light-800x480.png" alt="800x480" height="300"/>
<img src="nord-light-540x960.png" alt="540x960" height="300"/>
<img src="nord-light-960x540.png" alt="960x540" height="300"/>
<img src="nord-light-768x1024.png" alt="768x1024" height="300"/>
<img src="nord-light-1024x768.png" alt="1024x768" height="300"/>
<img src="nord-light-1280x800.png" alt="1280x800" height="300"/>
<img src="nord-light-1440x720.png" alt="1440x720" height="300"/>
<img src="nord-light-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-dark
@@ -47,3 +71,15 @@
<img src="pmos-dark-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-dark-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-dark-1920x1080.png" alt="1920x1080" height="300"/>
## pmos-light
<img src="pmos-light-480x800.png" alt="480x800" height="300"/>
<img src="pmos-light-800x480.png" alt="800x480" height="300"/>
<img src="pmos-light-540x960.png" alt="540x960" height="300"/>
<img src="pmos-light-960x540.png" alt="960x540" height="300"/>
<img src="pmos-light-768x1024.png" alt="768x1024" height="300"/>
<img src="pmos-light-1024x768.png" alt="1024x768" height="300"/>
<img src="pmos-light-1280x800.png" alt="1280x800" height="300"/>
<img src="pmos-light-1440x720.png" alt="1440x720" height="300"/>
<img src="pmos-light-1920x1080.png" alt="1920x1080" height="300"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show More