dotfiles/scripts/zbarimg-scan-barcode
2023-10-02 16:57:09 -06:00

12 lines
324 B
Bash
Executable file

#!/bin/sh
scrot -s "$HOME/.local/cache/barcode-%Y-%m-%d.png" || exit
OUTPUT="$(zbarimg -q "$HOME/.local/cache/barcode-"*)"
OUTPUT="${OUTPUT##QR-Code:}"
echo -n "$OUTPUT" | xsel -ib
echo "$OUTPUT"
notify-send -u low "QR code" "'$OUTPUT' copied to clipboard"
# Delete created files
rm -rf $HOME/.local/cache/barcode-*.png