diff options
| author | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-09-17 15:05:35 +0100 |
|---|---|---|
| committer | sommerfeld <sommerfeld@sommerfeld.dev> | 2026-09-17 15:05:35 +0100 |
| commit | 3aa51a5c01e7832605705cb71dc9a14f315c6e79 (patch) | |
| tree | 0762f000e30b28a72ac1fe357d3ad4fc956dd1a5 | |
| parent | 10b83c2c08eb7b102333d690c31b322dabc0719f (diff) | |
| download | dotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.tar.gz dotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.tar.bz2 dotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.zip | |
Prefer the dock camera and use the camera portal
| -rwxr-xr-x | dot_local/bin/executable_rqr | 20 | ||||
| -rw-r--r-- | etc/systemd/system/integrated-camera-off@.service | 12 | ||||
| -rw-r--r-- | etc/udev/rules.d/60-camera-priority.rules | 2 | ||||
| -rw-r--r-- | firefox/user-overrides.js | 3 | ||||
| -rw-r--r-- | run_onchange_after_deploy-flatpak-overrides.sh.tmpl | 6 |
5 files changed, 39 insertions, 4 deletions
diff --git a/dot_local/bin/executable_rqr b/dot_local/bin/executable_rqr index 76ea698..5b768ce 100755 --- a/dot_local/bin/executable_rqr +++ b/dot_local/bin/executable_rqr @@ -1,6 +1,24 @@ #!/usr/bin/env dash -text="$(zbarcam -q -1 --raw)" +set -eu + +camera="" +for candidate in \ + /dev/v4l/by-id/*HP_430_435_FHD_Webcam*-video-index0 \ + /dev/v4l/by-id/*-video-index0 \ + /dev/video*; do + if [ -e "$candidate" ]; then + camera="$candidate" + break + fi +done + +if [ -z "$camera" ]; then + echo "rqr: no camera found" >&2 + exit 1 +fi + +text="$(zbarcam -q -1 --raw "$camera")" printf '%s' "$text" | wl-copy echo "$text" diff --git a/etc/systemd/system/integrated-camera-off@.service b/etc/systemd/system/integrated-camera-off@.service new file mode 100644 index 0000000..6d7eaf8 --- /dev/null +++ b/etc/systemd/system/integrated-camera-off@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Disable the integrated camera while the HP camera is connected +BindsTo=%i.device +After=%i.device + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecCondition=/usr/bin/grep -qx 13d3 /sys/bus/usb/devices/1-8/idVendor +ExecCondition=/usr/bin/grep -qx 56a6 /sys/bus/usb/devices/1-8/idProduct +ExecStart=/usr/bin/sh -c 'printf 0 > /sys/bus/usb/devices/1-8/authorized' +ExecStop=-/usr/bin/sh -c 'printf 1 > /sys/bus/usb/devices/1-8/authorized' diff --git a/etc/udev/rules.d/60-camera-priority.rules b/etc/udev/rules.d/60-camera-priority.rules new file mode 100644 index 0000000..a12d5a6 --- /dev/null +++ b/etc/udev/rules.d/60-camera-priority.rules @@ -0,0 +1,2 @@ +# Disable the integrated camera while the HP external camera is connected. +ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="03f0", ATTR{idProduct}=="794a", TAG+="systemd", ENV{SYSTEMD_WANTS}+="integrated-camera-off@.service" diff --git a/firefox/user-overrides.js b/firefox/user-overrides.js index aa79951..3ea14a8 100644 --- a/firefox/user-overrides.js +++ b/firefox/user-overrides.js @@ -26,6 +26,9 @@ user_pref("media.gmp-provider.enabled", true); user_pref("media.gmp-gmpopenh264.enabled", true); user_pref("media.gmp-manager.url", "https://aus5.mozilla.org/update/3/GMP/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml"); +/** Camera **/ +user_pref("media.webrtc.camera.allow-pipewire", true); // use the camera portal instead of direct V4L2 + /** Network **/ user_pref("network.dns.disableIPv6", false); // keep IPv6 enabled diff --git a/run_onchange_after_deploy-flatpak-overrides.sh.tmpl b/run_onchange_after_deploy-flatpak-overrides.sh.tmpl index 47f3201..6412bb4 100644 --- a/run_onchange_after_deploy-flatpak-overrides.sh.tmpl +++ b/run_onchange_after_deploy-flatpak-overrides.sh.tmpl @@ -17,9 +17,9 @@ apply() { apply org.pwmt.zathura --filesystem=xdg-config/zathura:ro apply io.mpv.Mpv --filesystem=xdg-config/mpv:ro -# LibreWolf needs raw /dev access for v4l2 webcams. Flatpak has no -# finer-grained device option, so this opens video/dri/snd at once. -apply io.gitlab.librewolf-community --device=all +# LibreWolf uses the camera portal. Revoke its old broad device override while +# retaining direct rendering access from the application manifest. +apply io.gitlab.librewolf-community --nodevice=all --device=dri # Ungoogled Chromium needs /dev/hidraw* for WebHID (e.g. usevia.app # configuring ZSA keyboards). --device=all is the only knob flatpak |
