qrcode.plugin.zsh 486 B

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