scripts: add script to read QR codes
This commit is contained in:
parent
08d66a4053
commit
a3e77a9661
4 changed files with 29 additions and 0 deletions
18
scripts/readQrCode
Executable file
18
scripts/readQrCode
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue