others/qr.sh

26 lines
456 B
Bash
Executable File

#!/bin/sh
## create qr codes from any url in terminal with image file option as output ##
## qr.sh by @root_informatica ##
# it depends on libqrencode service
URL=$1
usage() {
cat<<EOF
usage: qr.sh <url>
EOF
}
if [ -n "$URL" ]; then
curl qrenco.de/$URL > /tmp/qr.txt
convert -size 250x250 \
xc:black \
-font "Hack-Bold" \
-fill white \
-pointsize 18 \
-annotate -30-20 "@/tmp/qr.txt" $URL-qr.png
else
usage
fi