Merge branch 'master' into johannes/nord-theme

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

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

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 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.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 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: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

@ -1,18 +1,8 @@
#!/bin/bash
function info() {
echo -e "[Info] $1"
}
source "$(dirname "${BASH_SOURCE[0]}")/../../test/helpers.sh"
function error() {
echo -e "\e[31m[Error]\e[0m $1"
}
function ok() {
echo -e "\e[32m[Ok]\e[0m $1"
}
function run_unl0kr() {
function run_unl0kr_async() {
local log=$1
local conf=$2
@ -23,3 +13,13 @@ function run_unl0kr() {
kill -9 $pid
wait $pid > /dev/null 2>&1
}
function run_unl0kr_sync() {
local log=$1
shift
local conf=$2
shift
local args=$@
./_build/unl0kr -v -C "$conf" $@ > "$log" 2>&1
}

View file

@ -18,7 +18,7 @@ backend=drm
EOF
info "Running unl0kr"
run_unl0kr "$log" "$conf"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using DRM backend" "$log"; then

View file

@ -11,7 +11,7 @@ function clean_up() {
trap clean_up EXIT
info "Running unl0kr"
run_unl0kr "$log"
run_unl0kr_async "$log"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then

View file

@ -18,7 +18,7 @@ backend=drm
EOF
info "Running unl0kr"
run_unl0kr "$log" "$conf"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then

View file

@ -18,7 +18,7 @@ backend=fb
EOF
info "Running unl0kr"
run_unl0kr "$log" "$conf"
run_unl0kr_async "$log" "$conf"
info "Verifying output"
if ! grep "Using framebuffer backend" "$log"; then

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 unl0kr"
run_unl0kr_sync "$log" "$conf" -V
info "Verifying output"
if ! grep "unl0kr $meson_version" "$log"; then
error "Expected version $meson_version"
cat "$log"
exit 1
fi
ok

View file

@ -4,13 +4,8 @@ root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
function run() {
info "Executing $1"
"$1"
echo
}
run "$root/build-with-drm.sh"
run "$root/test-uses-fb-backend-by-default.sh"
run "$root/test-uses-fb-backend-if-selected-via-config.sh"
run "$root/test-uses-drm-backend-if-selected-via-config-and-available.sh"
run_script "$root/build-with-drm.sh"
run_script "$root/test-version-matches-meson-and-changelog.sh"
run_script "$root/test-uses-fb-backend-by-default.sh"
run_script "$root/test-uses-fb-backend-if-selected-via-config.sh"
run_script "$root/test-uses-drm-backend-if-selected-via-config-and-available.sh"

View file

@ -4,13 +4,8 @@ root=$(dirname "${BASH_SOURCE[0]}")
source "$root/helpers.sh"
function run() {
info "Executing $1"
"$1"
echo
}
run "$root/build-without-drm.sh"
run "$root/test-uses-fb-backend-by-default.sh"
run "$root/test-uses-fb-backend-if-selected-via-config.sh"
run "$root/test-uses-fb-backend-if-drm-selected-via-config-but-unavailable.sh"
run_script "$root/build-without-drm.sh"
run_script "$root/test-version-matches-meson-and-changelog.sh"
run_script "$root/test-uses-fb-backend-by-default.sh"
run_script "$root/test-uses-fb-backend-if-selected-via-config.sh"
run_script "$root/test-uses-fb-backend-if-drm-selected-via-config-but-unavailable.sh"