summaryrefslogtreecommitdiff
path: root/plugins/qrcode/qrcode.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/qrcode/qrcode.plugin.zsh')
-rw-r--r--plugins/qrcode/qrcode.plugin.zsh17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/qrcode/qrcode.plugin.zsh b/plugins/qrcode/qrcode.plugin.zsh
new file mode 100644
index 000000000..d757e135e
--- /dev/null
+++ b/plugins/qrcode/qrcode.plugin.zsh
@@ -0,0 +1,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"
+}