Since we switched to viu, we should also have qr make use of it. Renamed the function to qrurl to make its purpose clearer (sending a simple file location/string/url via qr code) and to distinguish it from programs like qrcp which actually start a server and send a file through qr.
14 lines
359 B
Bash
14 lines
359 B
Bash
#!/usr/bin/env sh
|
|
# A nice little qc url creator.
|
|
# Takes whatever is passed and makes it qr-code readable
|
|
#
|
|
|
|
if exist viu; then
|
|
qrurl() {
|
|
# if we are in a pipe, read from stdin and set fct arguments to it
|
|
if [ ! -t 0 ]; then
|
|
set -- "$(cat /dev/stdin)"
|
|
fi
|
|
qrencode -s1 -m2 "$@" -o- | viu --upscale=i -
|
|
}
|
|
fi
|