scripts: add script to read QR codes

This commit is contained in:
Leonardo Eugênio 2024-03-27 12:40:22 -03:00
parent 08d66a4053
commit a3e77a9661
4 changed files with 29 additions and 0 deletions

18
scripts/readQrCode Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
set -o pipefail
main() {
if wl-paste | zbarimg -q --raw - | wl-copy
then
notify-send "Copied" "QrCode was copied to clipboard"
rm "$LOGFILE"
else
notify-send "Failed to read QrCode" "Log file is '$LOGFILE'"
fi
}
LOGFILE=$(mktemp /tmp/qrcode-XXXXXXXX.log)
main > "$LOGFILE" 2>&1