summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2026-03-05 13:51:42 -0700
committerJosh Rahm <rahm@google.com>2026-03-05 13:51:42 -0700
commiteb8b08fde673a9a5b6f1b2bc8daa6b23a3cf72d0 (patch)
treecfcdc257d21f19b2a8b8d4f69cee50a4e7992485
parent09faa547645657649e700614547ba2835bd85a23 (diff)
downloadbinfiles-eb8b08fde673a9a5b6f1b2bc8daa6b23a3cf72d0.tar.gz
binfiles-eb8b08fde673a9a5b6f1b2bc8daa6b23a3cf72d0.tar.bz2
binfiles-eb8b08fde673a9a5b6f1b2bc8daa6b23a3cf72d0.zip
add read-qrcode.shHEADmain
-rwxr-xr-xread-qrcode.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/read-qrcode.sh b/read-qrcode.sh
new file mode 100755
index 0000000..10bb595
--- /dev/null
+++ b/read-qrcode.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+# Create a temp file to store the screenshot
+tmpfile=$(mktemp -u /tmp/flameshot-XXXXXX.png)
+
+# Capture a screenshot to the temp file using flameshot GUI
+echo flameshot gui -p "$tmpfile"
+flameshot gui -p "$tmpfile"
+
+# Wait until the file actually exists and is non-empty
+sleep 1
+
+# Decode QR code from screenshot
+if [ -s "$tmpfile" ]; then
+ echo "[INFO] Scanning image for QR codes..."
+ zbarimg --raw "$tmpfile"
+else
+ echo "[WARN] No screenshot captured."
+fi
+
+# Clean up
+rm -f "$tmpfile"
+
+