chore(presence-detect): remove now-unused v4l2loopback provisioning

presence-detect.sh no longer mirrors the camera through a v4l2loopback device,
so the module setup is dead weight. Remove it:

- delete etc-v4l2loopback/ (modprobe.d + modules-load.d configs)
- drop the deploy blocks and linux-headers/v4l2loopback-dkms/v4l2loopback-utils
  package installs from the niri and hyprlua DE installers
- remove _ensure_v4l2loopback() and its call from sysupdate.sh
- reword enroll-biometrics.sh's loopback filter comment (kept as a harmless
  defensive exclusion) so it no longer points at the deleted config

Live system cleanup (module unload + /etc configs) is separate and needs root.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
main
Amir Alexander Abdelbaki 2026-07-11 04:11:16 +02:00
parent c2fa8d3e75
commit 05693a71b7
6 changed files with 4 additions and 104 deletions

View File

@ -82,10 +82,9 @@ is_capture_device() {
| grep -qE '^[[:space:]]*\[[0-9]+\]:'
}
# True for the v4l2loopback mirror presence-detect.sh feeds (card_label set in
# etc-v4l2loopback/modprobe.d/v4l2loopback.conf). It's not a real camera —
# configuring howdy or presence detection to read *from* it would just point
# them at their own mirrored output, so it's excluded from the picker.
# True for a v4l2loopback virtual device (card type "presence-loopback"). Kept
# as a defensive filter: presence-detect no longer uses a loopback, but should
# one ever be present it isn't a real camera, so it's excluded from the picker.
is_loopback_device() {
local card
card=$(v4l2-ctl --device="$1" --info 2>/dev/null \

View File

@ -1,11 +0,0 @@
# presence-detect.sh mirrors the real webcam into this virtual device so its
# 20s-interval motion checks never contend with other apps (Zoom, howdy, ...)
# for exclusive access to the physical camera.
#
# video_nr is fixed so the device always lands at /dev/video42, regardless of
# how many physical webcam nodes (including UVC metadata nodes) get enumerated
# first at boot.
#
# exclusive_caps=1 makes the device report standard single-purpose webcam
# capabilities, which most capture apps (ffmpeg, OpenCV, browsers) expect.
options v4l2loopback video_nr=42 card_label="presence-loopback" exclusive_caps=1

View File

@ -1 +0,0 @@
v4l2loopback

View File

@ -13,8 +13,7 @@
# - Config source paths point to desktopenvs/hyprlua/
# - Device-specific overrides live in ~/.config/hypr/usr/ (Lua modules
# loaded via require("usr.*")), not at ~/.config/ root
# - Adds python-opencv + v4l-utils for the webcam presence-detection daemon,
# plus v4l2loopback-dkms so it mirrors the camera instead of holding it
# - Adds python-opencv + v4l-utils for the webcam presence-detection daemon
# - Tablet mode also installs evdev-right-click-emulation from AUR
# - gsettings sets prefer-dark globally (relevant for GTK apps under Hyprland)
# - qt6ct is NOT installed (hyprlua dropped it from the package list)
@ -159,27 +158,9 @@ HYPRLUA_PACKAGES=(
python-opencv # OpenCV Python bindings; webcam presence-detection daemon
v4l-utils # Video4Linux2 tools for enumerating and configuring webcams
linux-headers # kernel headers needed to DKMS-build v4l2loopback below
v4l2loopback-dkms # virtual /dev/video device presence-detect.sh mirrors
v4l2loopback-utils # module keeps mirroring across kernel updates via DKMS
)
sudo pacman -Syu --noconfirm --needed -- "${HYPRLUA_PACKAGES[@]}"
# ---------------------------------------------------------------------------
# 2b. v4l2loopback camera mirror for presence-detect.sh
# ---------------------------------------------------------------------------
# presence-detect.sh reads motion off this virtual device instead of the real
# webcam, so its 20s-interval checks never contend with other apps (video
# calls, howdy) for exclusive access to the physical camera. Config here is
# static (fixed video_nr=42) — see etc-v4l2loopback/modprobe.d/v4l2loopback.conf
# for why. Loaded immediately so it's usable without a reboot.
log "Deploying v4l2loopback camera-mirror config..."
sudo install -Dm644 ~/Dotfiles/etc-v4l2loopback/modules-load.d/v4l2loopback.conf \
/etc/modules-load.d/v4l2loopback.conf
sudo install -Dm644 ~/Dotfiles/etc-v4l2loopback/modprobe.d/v4l2loopback.conf \
/etc/modprobe.d/v4l2loopback.conf
sudo modprobe v4l2loopback || warn "v4l2loopback did not load — presence-detect.sh will fall back to direct camera access until this is resolved (reboot may be required after a fresh DKMS build)."
# ---------------------------------------------------------------------------
# 3. Enable essential services
# ---------------------------------------------------------------------------

View File

@ -28,21 +28,10 @@ sudo pacman -Syu --noconfirm --needed \
pcmanfm-qt udisks2 ly kew \
pavucontrol playerctl wf-recorder sound-theme-freedesktop \
xinput jq python-opencv v4l-utils \
linux-headers v4l2loopback-dkms v4l2loopback-utils \
gtk-layer-shell # GTK3 wlr-layer-shell library EWW's gtk-layer-shell-sys
# crate links against; without it `cargo build` below
# fails at that build script with a pkg-config error.
# 2b. v4l2loopback camera mirror for presence-detect.sh — see hyprlua.sh for
# the full rationale (mirrors the real webcam into /dev/video42 so the daemon
# never contends with other apps for exclusive camera access).
log "Deploying v4l2loopback camera-mirror config..."
sudo install -Dm644 ~/Dotfiles/etc-v4l2loopback/modules-load.d/v4l2loopback.conf \
/etc/modules-load.d/v4l2loopback.conf
sudo install -Dm644 ~/Dotfiles/etc-v4l2loopback/modprobe.d/v4l2loopback.conf \
/etc/modprobe.d/v4l2loopback.conf
sudo modprobe v4l2loopback || warn "v4l2loopback did not load — presence-detect.sh will fall back to direct camera access until this is resolved (reboot may be required after a fresh DKMS build)."
# 3. Enable essential services
log "Enabling essential services..."
enable_service NetworkManager.service

View File

@ -760,62 +760,6 @@ _ensure_hyprshutdown() {
fi
}
# Ensure the v4l2loopback camera mirror presence-detect.sh reads motion off is
# installed, configured, and loaded. Not fatal to skip — presence-detect.sh
# falls back to opening the real camera directly when /dev/video42 is absent —
# but until this is set up the daemon is back to contending with other apps
# (video calls, howdy) for the physical camera, which is the whole point of
# the loopback mirror.
_ensure_v4l2loopback() {
local de_dir; de_dir=$(_de_source_dir)
[[ -n "${de_dir:-}" && -f "$de_dir/scripts/presence-detect.sh" ]] || return 0
local -a needed=(linux-headers v4l2loopback-dkms v4l2loopback-utils)
local -a missing=()
for pkg in "${needed[@]}"; do
pacman -Qq "$pkg" &>/dev/null || missing+=("$pkg")
done
if [[ ${#missing[@]} -eq 0 ]]; then
ok "v4l2loopback packages already installed"
else
warn "v4l2loopback camera mirror is missing packages: ${missing[*]}"
if ask "Install them now?"; then
if sudo pacman -S --noconfirm --needed "${missing[@]}"; then
ok "v4l2loopback packages installed"
else
warn "Failed to install some v4l2loopback packages"
fi
fi
fi
local src="$DOTFILES/etc-v4l2loopback"
if [[ ! -d "$src" ]]; then
warn "etc-v4l2loopback/ not found in dotfiles — skipping module config deploy"
return 0
fi
local changed=false f
for f in modules-load.d/v4l2loopback.conf modprobe.d/v4l2loopback.conf; do
if ! diff -q "$src/$f" "/etc/$f" &>/dev/null; then
sudo install -Dm644 "$src/$f" "/etc/$f" && changed=true
fi
done
if $changed; then
ok "v4l2loopback config deployed to /etc"
else
ok "v4l2loopback config already up to date"
fi
if lsmod | grep -q '^v4l2loopback'; then
ok "v4l2loopback module already loaded"
elif sudo modprobe v4l2loopback; then
ok "v4l2loopback module loaded"
else
warn "v4l2loopback failed to load — presence-detect.sh will fall back to direct camera access (a reboot may be required after a fresh DKMS build)"
fi
}
sync_configs() {
section "Config Sync"
@ -827,7 +771,6 @@ sync_configs() {
_ensure_plymouth_regreet
_ensure_astal_menu_deps
_ensure_hyprshutdown
_ensure_v4l2loopback
# ── Preferred: use the installed update-configs.sh ───────────────────────
local cfg_script