#!/bin/bash RES=$(zbarimg --raw "$1" 2> /dev/null) if [ $? -ne 0 ]; then notify-send -e "No QR Code detected" exit 0 fi ANSWER=$(notify-send -e -A 1="Copy to clipboard" -t 5000 "QR Code detected" "$RES") if [ "$ANSWER" == "1" ]; then echo "$RES" | xclip -selection clipboard fi