Commit Graph
2 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 5978bcf0f8 fix(beacon): add /dev/pts fallback for idle detection without xprintidle
The XScreenSaver extension is unavailable on this machine's X11 display.
Add /dev/pts youngest-atime as a fallback: the most recently accessed
pseudo-terminal is a reliable proxy for 'user is active in a terminal'
and needs no extra packages or group membership.

Detection order: libXss (XScreenSaver) → /dev/pts atime → 9999 (show beacon).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 17:11:48 +02:00
g-butandClaude Sonnet 4.6 45835c9ee3 fix(beacon): stop auto-injecting on timeout; add idle gate + instant notify
Three targeted fixes for the "prompt injection even when at keyboard" problem:

1. Remove the `choice="1"` fallback — when the beacon times out or Chrome fails
   to open, the hook now exits cleanly instead of auto-injecting slot 1 on top of
   whatever the user typed manually.

2. X11 idle gate — skip beacon entirely when the user has been active within the
   last 60 s (uses xprintidle if installed, falls back to libXss via ctypes, falls
   back to 9999 = always show beacon when neither is available).  Install
   xprintidle with `sudo apt install xprintidle` to enable on systems without the
   MIT-SCREEN-SAVER X11 extension.

3. Instant notify-send notification fires before Chrome launches so the user gets
   immediate visual feedback while the browser beacon popup loads (1–4 s on first
   Chrome launch, near-instant when Chrome is already running).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 17:05:09 +02:00