]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Adds qrpaste
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 18 Jan 2017 22:41:08 +0000 (20:41 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 18 Jan 2017 22:41:08 +0000 (20:41 -0200)
qrpaste [new file with mode: 0755]

diff --git a/qrpaste b/qrpaste
new file mode 100755 (executable)
index 0000000..7800c7d
--- /dev/null
+++ b/qrpaste
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# Display clipboard content into as qrcode
+#
+
+# Setup
+BASENAME="`basename $0`"
+TEMP="`mktemp -d`"
+OUT="$TEMP/clipboard.png"
+
+# Check
+if ! which qrencode &> /dev/null; then
+  echo "$BASENAME: qrencode not found"
+  exit 1
+elif ! which xclip    &> /dev/null; then
+  echo "$BASENAME: xclip not found"
+  exit 1
+fi
+
+# Run
+qrencode -o "$OUT" "`xclip -o`"
+display $OUT
+
+# Teardown
+rm -rf $TEMP