diff --git a/desktopenvs/hyprlua/scripts/enroll-biometrics.sh b/desktopenvs/hyprlua/scripts/enroll-biometrics.sh index 0e72859..09cfece 100755 --- a/desktopenvs/hyprlua/scripts/enroll-biometrics.sh +++ b/desktopenvs/hyprlua/scripts/enroll-biometrics.sh @@ -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 \ diff --git a/etc-v4l2loopback/modprobe.d/v4l2loopback.conf b/etc-v4l2loopback/modprobe.d/v4l2loopback.conf deleted file mode 100644 index 946b607..0000000 --- a/etc-v4l2loopback/modprobe.d/v4l2loopback.conf +++ /dev/null @@ -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 diff --git a/etc-v4l2loopback/modules-load.d/v4l2loopback.conf b/etc-v4l2loopback/modules-load.d/v4l2loopback.conf deleted file mode 100644 index d394e47..0000000 --- a/etc-v4l2loopback/modules-load.d/v4l2loopback.conf +++ /dev/null @@ -1 +0,0 @@ -v4l2loopback diff --git a/setup/modules/Desktop-Environments/hyprlua.sh b/setup/modules/Desktop-Environments/hyprlua.sh index 1d07f8a..d09f216 100755 --- a/setup/modules/Desktop-Environments/hyprlua.sh +++ b/setup/modules/Desktop-Environments/hyprlua.sh @@ -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 # --------------------------------------------------------------------------- diff --git a/setup/modules/Desktop-Environments/niri.sh b/setup/modules/Desktop-Environments/niri.sh index 3fe244b..face325 100755 --- a/setup/modules/Desktop-Environments/niri.sh +++ b/setup/modules/Desktop-Environments/niri.sh @@ -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 diff --git a/sysupdate.sh b/sysupdate.sh index c90e572..e1e73e9 100755 --- a/sysupdate.sh +++ b/sysupdate.sh @@ -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