diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-05-05 00:04:20 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-05-05 00:04:20 -0300 |
commit | 80fed34e09a841f0a4907b8311f6a997beebc544 (patch) | |
tree | 14cfea8f4a9c6dcb625cf506759fcf9c0774df4d | |
parent | 8b05c2ffd911b83bee7bd3eefe187ed057f0ebdf (diff) | |
download | utils-x11-80fed34e09a841f0a4907b8311f6a997beebc544.tar.gz utils-x11-80fed34e09a841f0a4907b8311f6a997beebc544.tar.bz2 |
Feat: qrpaste: support for content in the command line, falling back to clipboard
-rwxr-xr-x | qrpaste | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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 |