Status: accepted Β· Scope: RGB keyboard control only (decision by maintainer)
This document is the analysis done before any code was written: inventory of the existing backend, mapping of hardware communication, the alternatives considered for each major decision, and the justification for what was chosen.
Note: Predator NoSense is a standalone repository. The backend it drives β the
facerkernel module, its install scripts andfacer_rgb.pyβ is vendored unmodified underbackend/from the upstream project by Jafar Akhondali (GPL-3.0), so a clean checkout works on its own. Predator NoSense only invokesfacer_rgb.py; it does not modify the driver. SeeCREDITS.md.
The upstream project is an unofficial Acer kernel module (facer.ko, built from
facer.c) plus Python/Bash userspace helpers. Predator NoSense is a new client of
the interfaces that module exposes β it does not modify the driver.
The kernel module registers two character devices:
| Device | Payload | Purpose |
|---|---|---|
/dev/acer-gkbbl-0 |
16 bytes | Dynamic effects: mode, speed, brightness, direction, RGB |
/dev/acer-gkbbl-static-0 |
4 bytes | Per-zone static color (zone bitmask + RGB) |
On the maintainer's hardware these are mode 0666 (world-writable β no root needed).
The canonical userspace client is facer_rgb.py (repo root). It is the single source
of truth for:
- The exact byte layout written to each device (see
facer_rgb.py:170-206). - The 6 effect modes:
0 Static Β· 1 Breath Β· 2 Neon Β· 3 Wave Β· 4 Shifting Β· 5 Zoom. - Parameters:
-mmode,-zzone(1-4),-sspeed(0-9),-bbrightness(0-100),-ddirection(1=RβL, 2=LβR),-cR/-cG/-cBcolor. - Profiles:
-save NAME,-load NAME,-list, stored as JSON in~/.config/predator/saved profiles/.
keyboard.py is an interactive TUI wrapper around the same logic β not used by the GUI.
src/facer.c contains WMI plumbing for fan-speed reading (hwmon), CPU/GPU temperature
sensors, platform_profile (quiet/balanced/performance), and internal fan-mode calls.
These are out of scope for this GUI per the maintainer's decision, and several are not
even advertised on the maintainer's PHN16-71 (empty platform_profile, no acer hwmon β
see Β§4). They are documented here only so future contributors know they exist.
ββββββββββββββββββββββ Tauri IPC βββββββββββββββββββββββ process spawn ββββββββββββββββ write() ββββββββββββββββββββββ
β React UI (webview)β ββββββββββββββΆ β Rust commands β βββββββββββββββββΆ β facer_rgb.py β ββββββββββββΆ β /dev/acer-gkbbl-* β
β React + Zustand β ββββββββββββββ β (backend.rs) β βββββββββββββββββ β (existing) β (kernel) β char devices β
ββββββββββββββββββββββ results βββββββββββββββββββββββ stdout/stderr ββββββββββββββββ ββββββββββββββββββββββ
The abstraction layer is src-tauri/src/backend.rs: it builds facer_rgb.py argument
vectors, locates the interpreter + script, runs them, and surfaces structured errors to the
UI. Profile list/save/load are delegated straight to facer_rgb.py.
Alternatives
- (A) Shell out to
facer_rgb.pyβ chosen. The Rust layer constructs CLI args and runs the existing script. - (B) Re-implement the 16-/4-byte payload writer in Rust. Self-contained binary, no Python at runtime, but duplicates protocol logic that already exists.
Justification. The maintainer explicitly required "create an abstraction layer to
communicate with the existing backend" and "avoid rewriting already-implemented
functionality." facer_rgb.py already owns the byte layout and the profile format;
re-implementing risks silent divergence if the protocol ever changes. python3 is
universally present on Linux desktops (3.14 here). The script is bundled as a Tauri
resource so the app stays installable as one package. The Rust boundary is thin enough that
switching to option (B) later is localized to backend.rs.
- Tauri v2, frameless (
decorations: false) β the app draws its own title bar. - No component library. The UI was rebuilt from a bespoke design in which every surface
is custom: the four-zone keyboard render, the HSV colour picker, the sliders and the
toggles. Mantine was dropped in that rewrite because none of it survived β its widgets
were being overridden into invisibility, so it cost four dependencies and a theme override
to contribute nothing. Plain CSS in
src/styles.cssplus small primitives insrc/components/primitives.tsxreplace it. - Zustand for state, persisted to
localStorage(user choices only, never device state). - Pure logic lives in
src/lib/β colour conversion, effect maths, keyboard layout, zone selection β so it can be tested without a DOM.npm testruns those under Vitest;cargo testcovers the profile-metadata reader. - Recharts dropped: it was requested for monitoring graphs; the RGB-only scope has no time-series to chart, so adding it would be dead weight.
list_profiles shells out to facer_rgb.py -list, so it fails when the kernel module is
absent. list_profiles_meta instead reads ~/.config/predator/saved profiles directly and
returns each profile's settings and mtime, which keeps the Profiles page usable when the
keyboard is not available. A malformed file is skipped rather than failing the listing.
Char devices are 0666 here β the GUI writes with no elevation. For hardware where the
devices are root-only, backend.rs supports a pkexec fallback (a udev rule is the
recommended permanent fix, documented in BUILD.md). No setuid binaries are introduced.
Per maintainer decision, fan RPM, performance profiles, manual fan control, fan curves, and per-key RGB are excluded (not implemented in the backend and/or absent on this hardware). Nothing in the existing project is removed or disabled.
Model Acer Predator PHN16-71, module facer loaded:
| Capability | Status | Source |
|---|---|---|
| RGB char devices | β
present, 0666 |
/dev/acer-gkbbl-0, -static-0 |
platform_profile |
β empty | /sys/firmware/acpi/platform_profile |
acer hwmon / fan RPM |
β absent | no fan*_input |
| CPU temp | β | coretemp hwmon |
| GPU temp | β | nvidia-smi (RTX 4060 Mobile) |
These confirm the RGB-only scope is the honest, fully-functional subset on this laptop.