Draw the e-ink face from picture packs, with a built-in kestrel pack #191

Merged
aluminum-ice merged 1 commit from eink-face-packs into main 2026-11-14 16:04:56 +00:00
Owner

What this PR does

Lets both e-ink plugins draw the face from a picture pack instead of the text emoticons, through a new terminal-only face_pack option, and ships an original pack, kestrel, drawn in code.

  • eink_face library 1.1 → 1.2 (additive). FacePack(name) resolves the option once:
    • kestrel is the built-in pack: the bird's face (round eyes, the dark stripe under each, a small hooked beak), one picture for every key of FACES, drawn by draw_pack_face from KESTREL_PACK and fitted to each panel.
    • any other name is a folder of <face>.png under /etc/kestrel/faces/ (PACK_DIR), which only an admin can fill; the name is held to [a-z0-9][a-z0-9_-]{0,31}, so it can't point anywhere else.
    • files are opened O_NOFOLLOW, must be regular, at most 512 KB and 2048 px a side, and PNG; transparent counts as white; each is fitted to the face area and made 1-bit. A face the pack lacks falls back to the nearest classic face for Kestrel's own five moods (PACK_FALLBACK), then to the text face.
    • a pack changes how a mood looks, never which mood shows.
  • eink-ws27 0.3.0 and eink-ws213 0.2.0. A face_pack option (str, default empty, root_only), the picture pasted centred in the old face area (130 x 46 and 88 x 35), and a Face pack card row when the option is set (the pack in use, or why none is).
  • Docs: GUIDE_MD, both e-ink setup guides (a Face packs section with the mood names, sizes, limits and the install commands), plugin-libraries.md, and CLAUDE.md.
  • User guide figure: eink-face-pack (since = "1.0.14"), the panel frame with the kestrel pack. guide.toml figures gain eink_options (plugin options for that frame only), which fixture.eink_image() applies and restores.

Checklist

  • Lint passes — the real-data check is clean locally; ansible, yamllint and shellcheck aren't installed here, so the Lint workflow runs those (no YAML or shell changed).
  • Tests pass — tests/test_eink_face_packs.py (24 new tests) and the e-ink, library, declaration and core-lean tests pass. In the full suite, 1,739 pass; the 5 test_web.py potfile-import tests fail locally exactly as on main (local werkzeug), so CI is the check for those.
  • Nothing real: no secrets, no personal information, no real data. The pack is original line art drawn in code; screenshots come from the demo fixture.
  • Consent gates intact. Display only: no new capability, nothing near capture or the acknowledgment.
  • Docs updated in the same PR.
  • Commit messages are short and imperative.

Release impact

  • App-layer-safe — only plugins/*.py and the kestrel_pi package (userguide.py) change on the device; the docs and tools/ghost-guide/ aren't shipped. /etc/kestrel/faces/ isn't created by the build; operators make it with sudo install -d (documented).
  • Reflash-class

Notes for review

  • Terminal-only by design. face_pack is root_only, so the Plugins page shows it read-only, and the folder is root-owned, so the dashboard can never pick or plant a pack an admin didn't install. A dashboard picker or a zip upload would be a follow-up.
  • Not seen on a real panel yet. The frames are the same 1-bit images the panels and the web mirror already show, rendered here through the plugins' own compositors at both sizes; the next beta check is the first look on hardware.
  • Copyright. The docs ask operators to use only pictures they have the right to use; no third-party character art is included.

🤖 Generated with Claude Code

## What this PR does Lets both e-ink plugins draw the face from a **picture pack** instead of the text emoticons, through a new terminal-only `face_pack` option, and ships an original pack, `kestrel`, drawn in code. - **`eink_face` library 1.1 → 1.2 (additive).** `FacePack(name)` resolves the option once: - `kestrel` is the built-in pack: the bird's face (round eyes, the dark stripe under each, a small hooked beak), one picture for every key of `FACES`, drawn by `draw_pack_face` from `KESTREL_PACK` and fitted to each panel. - any other name is a folder of `<face>.png` under `/etc/kestrel/faces/` (`PACK_DIR`), which only an admin can fill; the name is held to `[a-z0-9][a-z0-9_-]{0,31}`, so it can't point anywhere else. - files are opened `O_NOFOLLOW`, must be regular, at most 512 KB and 2048 px a side, and PNG; transparent counts as white; each is fitted to the face area and made 1-bit. A face the pack lacks falls back to the nearest classic face for Kestrel's own five moods (`PACK_FALLBACK`), then to the text face. - a pack changes how a mood looks, never which mood shows. - **`eink-ws27` 0.3.0 and `eink-ws213` 0.2.0.** A `face_pack` option (`str`, default empty, `root_only`), the picture pasted centred in the old face area (130 x 46 and 88 x 35), and a **Face pack** card row when the option is set (the pack in use, or why none is). - **Docs:** `GUIDE_MD`, both e-ink setup guides (a *Face packs* section with the mood names, sizes, limits and the install commands), `plugin-libraries.md`, and `CLAUDE.md`. - **User guide figure:** `eink-face-pack` (`since = "1.0.14"`), the panel frame with the kestrel pack. `guide.toml` figures gain `eink_options` (plugin options for that frame only), which `fixture.eink_image()` applies and restores. ## Checklist - [x] **Lint passes** — the real-data check is clean locally; ansible, yamllint and shellcheck aren't installed here, so the **Lint** workflow runs those (no YAML or shell changed). - [x] **Tests pass** — `tests/test_eink_face_packs.py` (24 new tests) and the e-ink, library, declaration and core-lean tests pass. In the full suite, 1,739 pass; the 5 `test_web.py` potfile-import tests fail locally exactly as on `main` (local werkzeug), so CI is the check for those. - [x] **Nothing real: no secrets, no personal information, no real data.** The pack is original line art drawn in code; screenshots come from the demo fixture. - [x] **Consent gates intact.** Display only: no new capability, nothing near capture or the acknowledgment. - [x] **Docs updated in the same PR.** - [x] Commit messages are short and imperative. ## Release impact - [x] **App-layer-safe** — only `plugins/*.py` and the `kestrel_pi` package (`userguide.py`) change on the device; the docs and `tools/ghost-guide/` aren't shipped. `/etc/kestrel/faces/` isn't created by the build; operators make it with `sudo install -d` (documented). - [ ] **Reflash-class** ## Notes for review - **Terminal-only by design.** `face_pack` is `root_only`, so the Plugins page shows it read-only, and the folder is root-owned, so the dashboard can never pick or plant a pack an admin didn't install. A dashboard picker or a zip upload would be a follow-up. - **Not seen on a real panel yet.** The frames are the same 1-bit images the panels and the web mirror already show, rendered here through the plugins' own compositors at both sizes; the next beta check is the first look on hardware. - **Copyright.** The docs ask operators to use only pictures they have the right to use; no third-party character art is included. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Draw the e-ink face from picture packs, with a built-in kestrel pack
All checks were successful
Lint / lint (push) Successful in 31s
Test / test (push) Successful in 57s
Lint / lint (pull_request) Successful in 28s
Test / test (pull_request) Successful in 52s
368d6ac290
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch eink-face-packs 2026-11-14 16:04:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/kestrel!191
No description provided.