nixos-config/scripts/readQrCode
2024-03-27 12:40:22 -03:00

19 lines
333 B
Bash
Executable file

#!/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