#!/bin/sh dir=$(mktemp --tmpdir -d) trap "rm -rf '$dir'" EXIT INT TERM file=$(mktemp --tmpdir="$dir" screenshot-XXXX.png) flameshot gui --accept-on-select -r > "$file" zbarimg --raw $file