summaryrefslogtreecommitdiffstatshomepage
path: root/dot_local/bin
diff options
context:
space:
mode:
authorsommerfeld <sommerfeld@sommerfeld.dev>2026-09-17 15:05:35 +0100
committersommerfeld <sommerfeld@sommerfeld.dev>2026-09-17 15:05:35 +0100
commit3aa51a5c01e7832605705cb71dc9a14f315c6e79 (patch)
tree0762f000e30b28a72ac1fe357d3ad4fc956dd1a5 /dot_local/bin
parent10b83c2c08eb7b102333d690c31b322dabc0719f (diff)
downloaddotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.tar.gz
dotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.tar.bz2
dotfiles-3aa51a5c01e7832605705cb71dc9a14f315c6e79.zip
Prefer the dock camera and use the camera portal
Diffstat (limited to 'dot_local/bin')
-rwxr-xr-xdot_local/bin/executable_rqr20
1 files changed, 19 insertions, 1 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"