qrshot

Decode QR code on screen, or encode a string then echo QR code on terminal, on Linux
git clone git://git.janpasierb.com/qrshot.git
Log | Files | Refs | README

commit 602539b8d48c7502224ab0205c50bdfba3def053
Author: Gary Williams <acadsear@yahoo.com>
Date:   Thu, 31 May 2018 17:42:00 +0800

Initial commit

Diffstat:
AREADME.md | 21+++++++++++++++++++++
Aencode.png | 0
Aqrshot | 15+++++++++++++++
3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/README.md b/README.md @@ -0,0 +1,21 @@ +# qrshot +Decode QR code on screen, or encode a string then echo QR code on terminal, on Linux. + +## Usage + +### Decode + +Run `qrshot` in terminal, use mouse to select QR code area on screen. + +### Encode + +``` +$ qrshot "Sample string" +``` +![encoding screenshot](encode.png) + +## Dependencies + +- scrot - screen capturer +- zbar - image QR decoder +- qrencode - QR encoder diff --git a/encode.png b/encode.png Binary files differ. diff --git a/qrshot b/qrshot @@ -0,0 +1,15 @@ +#!/bin/bash + +if [[ ! "$1" ]]; then + + TMPDIR=/dev/shm + cd "$TMPDIR" + + echo Use mouse select an area on screen to decode QR + echo "" + + scrot -s -e 'echo Image size $w x $h ; echo "" ; zbarimg "$f" ; rm "$f" ' + +else + qrencode -m 2 -t ANSIUTF8 "$1" +fi