qrcode.plugin.zsh
486 bytes
1# Imported and improved from https://qrcode.show/, section SHELL FUNCTIONS
2
3_qrcode_show_message() {
4 echo "Type or paste your text, add a new blank line, and press ^d"
5}
6
7qrcode () {
8 local input="$*"
9 [ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
10 curl -d "$input" https://qrcode.show
11}
12
13qrsvg () {
14 local input="$*"
15 [ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
16 curl -d "$input" https://qrcode.show -H "Accept: image/svg+xml"
17}