scripts/bash/qr.bash

20 lines
518 B
Bash
Raw Normal View History

2021-02-22 20:45:08 +01:00
#!/usr/bin/env bash
# Arguments: Name & content
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
# -s $PIXELSIZE doubles the dot/pixel size from 3
PIXELSIZE=6
2021-02-22 20:45:08 +01:00
# Outputs QR code to terminal
2023-02-02 07:45:44 +01:00
# ${@:2} takes all arguments except the first one
2021-02-22 20:45:08 +01:00
qrencode -l H -t utf8 "${@:2}"
# Stores QR code as $1.png (first argument)
qrencode -s $PIXELSIZE -l H -o "$1".png "${@:2}"
2023-01-31 09:49:28 +01:00
# My stepfather wants jpg
convert "$1".png "$1".jpg
2021-02-22 20:45:08 +01:00
# Prints details
echo "Name: $1.png"
echo "Content: ${@:2}"