summaryrefslogtreecommitdiff
path: root/plugins/qrcode/qrcode.plugin.zsh
blob: d757e135e4acef82f7881c0caba446787a85f5b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Imported and improved from https://qrcode.show/, section SHELL FUNCTIONS

_qrcode_show_message() {
  echo "Type or paste your text, add a new blank line, and press ^d"
}

qrcode () {
  local input="$*"
  [ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
  curl -d "$input" https://qrcode.show
}

qrsvg () {
  local input="$*"
  [ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
  curl -d "$input" https://qrcode.show -H "Accept: image/svg+xml"
}