{qr,wifiqr}.bash: make make PIXELSIZE a variable

This commit is contained in:
Aminda Suomalainen 2023-02-01 19:40:31 +02:00
parent f81a0ca221
commit 3f2886733a
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
2 changed files with 6 additions and 3 deletions

View File

@ -3,14 +3,15 @@
# Arguments: Name & content
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
# -s 6 doubles the dot/pixel size
# -s $PIXELSIZE doubles the dot/pixel size from 3
PIXELSIZE=6
# Outputs QR code to terminal
# ${@:2} takes all arguments except not the first one
qrencode -l H -t utf8 "${@:2}"
# Stores QR code as $1.png (first argument)
qrencode -s 6 -l H -o "$1".png "${@:2}"
qrencode -s $PIXELSIZE -l H -o "$1".png "${@:2}"
# My stepfather wants jpg
convert "$1".png "$1".jpg
# Prints details

View File

@ -4,10 +4,12 @@
# -l H uses the highest error correction in case 30 % gets damaged (or artistried upon)
PIXELSIZE=6
# Outputs QR code to terminal
qrencode -l H -t utf8 "WIFI:T:WPA;S:$1;P:$2;;"
# Stores QR code as SSID.png, -s doubles pixel size from default 3
qrencode -l H -s 6 -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
qrencode -l H -s $PIXELSIZE -o $1.png "WIFI:T:WPA;S:$1;P:$2;;"
# Might as well jpg this too
convert "$1".png "$1".jpg