#qr #ansi #ansi-term #codes #stdin #renders #terminals

app qrgen

Renders input from stdin as QR codes on ANSI terminals

1 unstable release

0.1.0 May 2, 2020

#9 in #terminals

MIT license

8KB
80 lines

qrgen

Renders input from stdin as QR codes on ANSI terminals.

Installation

It is recommended to install Rust stable using Rustup. In order to build and install qrgen, run the following command:

cargo install --path .

Usage

USAGE:
    qrgen [FLAGS] [OPTIONS]

FLAGS:
    -h, --help       Prints help information
    -s, --small      Outputs a smaller code.
        --svg        Outputs a SVG image
    -V, --version    Prints version information

OPTIONS:
    -m, --margin <margin>    Margin size

Display QR code in terminal

$ echo "foobar" | qrgen


    ██████████████      ██████  ██████████████
    ██          ██  ██████  ██  ██          ██
    ██  ██████  ██      ██████  ██  ██████  ██
    ██  ██████  ██  ████    ██  ██  ██████  ██
    ██  ██████  ██    ██    ██  ██  ██████  ██
    ██          ██  ██    ██    ██          ██
    ██████████████  ██  ██  ██  ██████████████
                      ██
    ██████████  ██████    ██  ██  ██  ██  ██
    ██  ████████      ██  ████████    ██  ██
    ██      ████████        ██  ████
    ████  ██            ██████████    ██  ██
        ██████  ██      ██  ██    ██    ██
                    ██  ██  ██    ██    ██
    ██████████████  ████  ██  ██    ██████████
    ██          ██    ██          ████  ██  ██
    ██  ██████  ██  ████████  ██    ██████████
    ██  ██████  ██  ██████████████    ██
    ██  ██████  ██  ██      ██  ████
    ██          ██  ██    ████████    ██
    ██████████████  ██      ██    ██    ██



Display QR code in terminal (small)

$ echo "foobar" | qrgen --small

  █▀▀▀▀▀█ ▄▄█▀█ █▀▀▀▀▀█
   ███ █ ▄▄▀▀█ █ ███ █
   ▀▀▀ █ ▄▀ ▄▀ █ ▀▀▀ █
  ▀▀▀▀▀▀▀ ▀▄▀ ▀ ▀▀▀▀▀▀▀
  ▀▀▀▀▀ ▀▀█  █▄█▄█ █ ▀▄
   █▀▀█ ▀▄▀█▄▄█▄██▄█▄▀▄
   ▀ ▀▀▀▀█▀  █  █▀▄ ▀▄
  █▀▀▀▀▀█ ▀▀█▀ ▀ █▄█▄█▄
   ███ █ █▀▀█▄█▄▀▄ ▄▀
   ▀▀▀ █ █▀█▄█▄█  ▄▄
  ▀▀▀▀▀▀▀ ▀   ▀  ▀   ▀

Display QR code as image

The following command generates and displays a generated QR code using ImageMagick's display command.

$ echo "foobar" | qrgen --svg | display -antialias -resample 500% -define filter:support=0 -

License

MIT

Dependencies

~2MB
~25K SLoC