aboutsummaryrefslogtreecommitdiff
path: root/qrpaste
diff options
context:
space:
mode:
Diffstat (limited to 'qrpaste')
-rwxr-xr-xqrpaste10
1 files changed, 9 insertions, 1 deletions
diff --git a/qrpaste b/qrpaste
index 889bd17..6a30e4d 100755
--- a/qrpaste
+++ b/qrpaste
@@ -8,6 +8,7 @@ BASENAME="`basename $0`"
TEMP="`mktemp -d`"
OUT="$TEMP/clipboard.png"
SIZE="15"
+ARGS="$*"
# Check
if ! which qrencode &> /dev/null; then
@@ -21,8 +22,15 @@ elif ! which display &> /dev/null; then
exit 1
fi
+# Grab the content
+if [ ! -z "$ARGS" ]; then
+ CONTENT="$ARGS"
+else
+ CONTENT="`xclip -o`"
+fi
+
# Run
-qrencode -o "$OUT" "`xclip -o`" -s $SIZE
+qrencode -o "$OUT" "$CONTENT" -s $SIZE
display $OUT
# Teardown