{ writeShellApplication, grimblast, libnotify, tesseract, wl-clipboard, yq, zbar, }: writeShellApplication { name = "screenshot-area-scan-qr"; runtimeInputs = [ grimblast libnotify tesseract wl-clipboard yq zbar ]; text = '' umask 077 # Create in-memory tmpfile TMPFILE=$(mktemp) exec 3<>"$TMPFILE" rm "$TMPFILE" # still open in-memory as /dev/fd/3 TMPFILE=/dev/fd/3 if grimblast --freeze save area - \ | zbarimg --xml - > "$TMPFILE"; then N=$(xq -r '.barcodes.source.index.symbol | if type == "array" then length else 1 end' < "$TMPFILE") # Append codes Copy data separated by --- DATA=$(xq -r '.barcodes.source.index.symbol | if type == "array" then .[0].data else .data end' < "$TMPFILE") for ((i=1;i