summarylogtreecommitdiffstats
path: root/zbarscan
blob: 3cd938c386de311c871ade2db762b392520422aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

if [ -z "${1}" ]; then
	echo "No file given." >&2
	exit 1
fi

if [ ! -s "${1}" ]; then
	echo "File '${1}' does not exist." >&2
	exit 1
fi

zenity --info --no-markup \
	--title="Scan with ZBar" \
	--icon-name="zbarscan" \
	--text="$(zbarimg --raw -q "${1}" || \
	echo "Failed to scan image file for code.")"