Layer 1 (< 100ms): notify-choice.py shows a native KDE notification with
action buttons built from the first 3 prompt slots. Uses gi.repository.Notify
+ GLib event loop so actions are properly wired (plain notify-send --action
is not supported by the KDE notification server). When clicked:
- prints the slot number (choice)
- patches /tmp/cockpit-beacon/{id}.json so the browser beacon sees
choice != null and window.close()s itself within 500ms
Layer 2 (1-4s): beacon_python opens the full browser beacon in parallel.
Both layers write to a shared tempfile via atomic mv — first write wins.
The main loop polls every 200ms, kills both processes on first result.
If neither layer produces a choice (user is at keyboard, typing manually),
the hook exits cleanly without injecting anything.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>