Dotfiles/desktopenvs/hyprlua/scripts/python
Amir Alexander Abdelbaki bc544898c1 fix(presence-detect): read camera directly instead of v4l2loopback mirror
The loopback feeder (defa69f) held /dev/video0 open 24/7, so real apps —
video calls, howdy — could never open the camera, and the single loopback
device only ever served one reader at a time (a second consumer got
VIDIOC_REQBUFS -EBUSY). Net effect: the camera was permanently blocked and
nothing could access it.

Drop the ffmpeg mirror and read the physical camera directly, only for the
~0.5s per tick it takes to grab frames, then release it — so the camera is
free for other apps the rest of the time. When another app is already holding
the camera, the Python detector now distinguishes "busy/in use" (device node
present but unreadable → exit 3) from "unavailable" (node gone → exit 2), and
the daemon treats busy as presence: a camera in use is itself proof the user
is here, so a video call keeps the session awake.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 03:51:44 +02:00
..
boilerplate.py feat: add hyprlua config set and migrate hyprland envvars to dedicated file 2026-05-19 08:50:23 +02:00
ispeedtest.py feat: add hyprlua config set and migrate hyprland envvars to dedicated file 2026-05-19 08:50:23 +02:00
presence_detect.py fix(presence-detect): read camera directly instead of v4l2loopback mirror 2026-07-11 03:51:44 +02:00