summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Bobov <anton@bobov.name>2025-08-01 09:34:12 +0500
committerAnton Bobov <anton@bobov.name>2025-08-01 09:34:12 +0500
commit1630da7e1a1e48a1706d8657bd3958ffaa753d1c (patch)
tree66bcf2be92284fcb64e4e7164f9d6f01f10976ac
parenta6ce11d6269b40fd328abd9c2ccde9baf45059a9 (diff)
Script to grub QR from screen
-rwxr-xr-xqr-scan18
1 files changed, 18 insertions, 0 deletions
diff --git a/qr-scan b/qr-scan
new file mode 100755
index 0000000..a2760b9
--- /dev/null
+++ b/qr-scan
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+check_cmd() {
+ if ! type -p "$1" >/dev/null; then
+ echo "No command: $1" >&2
+ return 1
+ fi
+}
+
+main() {
+ check_cmd scrot
+ check_cmd zbarimg
+ scrot --freeze --quality 95 --select -e 'zbarimg --quiet --raw "$f"; rm "$f"'
+}
+
+main "$@"