examples: agent-eyes subcommand helper (status/shot/run/record)
One front door to the headless session, for reuse by any consumer: it discovers whichever wayland-N socket exists, re-execs itself under sg hhstream when the login predates the group membership, and encodes recordings at the measured frame rate so clips play at true speed.
This commit is contained in:
1 parent
2b32153c8b
commit
09903c5676
2 files changed
+191
No files matched your search
@@ -1,5 +1,32 @@
|
||||
# examples
|
||||
|
||||
## `agent-eyes` — the short commands
|
||||
|
||||
The everyday front door to the session: one subcommand each, no environment
|
||||
juggling, and it re-execs itself under `sg hhstream` when the login predates the
|
||||
group membership.
|
||||
|
||||
```bash
|
||||
examples/agent-eyes status # services, socket, group access, liveness probe
|
||||
examples/agent-eyes shot --out /tmp/s.jpg # one frame of the screen
|
||||
examples/agent-eyes run -- chromium ... # launch a GUI app INTO the session
|
||||
examples/agent-eyes record --seconds 10 --out clip.mp4
|
||||
```
|
||||
|
||||
- `shot` defaults to `/var/lib/hermes/public/agent-eyes/latest.jpg`, which the
|
||||
local file server already publishes, so the newest frame is always one
|
||||
browser refresh away.
|
||||
- `run` sets `XDG_RUNTIME_DIR`, `WAYLAND_DISPLAY` (it discovers whichever
|
||||
`wayland-N` exists rather than assuming `wayland-0`) and `XDG_SESSION_TYPE`,
|
||||
then `exec`s the command. Everything it launches runs as *your* user, not the
|
||||
service user.
|
||||
- `record` reads frames off the socket for the given wall-clock seconds and
|
||||
encodes at the **measured** rate, so the clip plays at true speed. It strips
|
||||
metadata for the media stores, same as the demo.
|
||||
|
||||
Both `shot` and `record` want nothing but `hhstream-client`, `python3` and
|
||||
`ffmpeg`, which are all on the system PATH; only `chromium` needs `nix develop`.
|
||||
|
||||
## `agent-eyes-demo.py`
|
||||
|
||||
Puts a real browser on the headless screen, drives it, and films the result by
|
||||
|
||||
Reference in new issue
Block a user