Giter Club home page Giter Club logo

qrc's Introduction

QR code generator for text terminals

What's this?

This program generates QR codes in ASCII art or Sixel format for text terminals, e.g., console, xterm (with -ti 340 option to enable Sixel), mlterm, Windows command prompt and so on.

Use case

You can transfer data to smartphones with a QR code reader application from your terminal.

Usage

qrc program takes a text from command-line argument or standard input (if no command-line argument) and encodes it to a QR code.

$ qrc --help
Usage: qrc [OPTIONS] [TEXT]

Options:
  -h, --help
    Show this help message
  -i, --invert
    Invert color

Text examples:
  http://www.example.jp/
  MAILTO:[email protected]
  WIFI:S:myssid;T:WPA;P:pass123;;
$ qrc https://fumiyas.github.io/
...
$ qrc 'WIFI:S:Our-ssid;T:WPA;P:secret;;'
...

You can get a QR code in Sixel graphics if the standard output is a terminal and it supports Sixel.

Download

Binary files are here for Linux, Mac OS X and Windows:

Build from source codes

If you have Go language environment, try the following:

$ go get github.com/fumiyas/qrc/cmd/qrc

TODO

  • Add the following options:
    • --format <aa|sixel>
    • --aa-color-scheme <ansi|windows>
    • --foreground-color R:G:B
    • --background-color R:G:B
    • --margin-color R:G:B
    • --margin-size N
    • --input-encoding E
  • Timeout for tty.GetDeviceAttributes1()

Contributors

  • Hayaki Saito (@saitoha)

Similar products

qrc's People

Contributors

fumiyas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qrc's Issues

No arm64 binary

It would be great if there was a precompiled binary for arm64 on linux. Bonus points for silicon Mac.

Doesn’t build on macOS 12.4 / M1

go: downloading github.com/fumiyas/qrc v0.1.1
go: finding module for package github.com/mgutz/ansi
go: finding module for package code.google.com/p/rsc/qr
go: finding module for package github.com/mattn/go-colorable
go: finding module for package github.com/jessevdk/go-flags
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/jessevdk/go-flags v1.5.0
go: found github.com/jessevdk/go-flags in github.com/jessevdk/go-flags v1.5.0
go: found github.com/mattn/go-colorable in github.com/mattn/go-colorable v0.1.12
go: found github.com/mgutz/ansi in github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
go: finding module for package code.google.com/p/rsc/qr
go/pkg/mod/github.com/fumiyas/[email protected]/cmd/qrc/qrc.go:4:2: cannot find module providing package code.google.com/p/rsc/qr: unrecognized import path "code.google.com/p/rsc/qr": parse https://code.google.com/p/rsc/qr?go-get=1: no go-import meta tags ()```

Crashes on macOS 10.15.7

Downloaded newest release v0.1.1, set x-bit and executed it on macOS 10.15.7 (Intel). Result:

$ /Users/gh/Downloads/qrc_darwin_amd64 <2>
failed MSpanList_Insert 0x236000 0x9c1a2ab5cac 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x1ed0fb)
/usr/lib/go/src/pkg/runtime/panic.c:520 +0x69
runtime.MSpanList_Insert(0x203428, 0x236000)
/usr/lib/go/src/pkg/runtime/mheap.c:618 +0x8a
MHeap_FreeLocked(0x1ff420, 0x236000)
/usr/lib/go/src/pkg/runtime/mheap.c:447 +0x1a6
MHeap_Grow(0x1ff420, 0x10)
/usr/lib/go/src/pkg/runtime/mheap.c:341 +0x1ae
MHeap_AllocLocked(0x1ff420, 0x1, 0x2)
/usr/lib/go/src/pkg/runtime/mheap.c:222 +0x379
runtime.MHeap_Alloc(0x1ff420, 0x1, 0x10000000002)
/usr/lib/go/src/pkg/runtime/mheap.c:178 +0x7b
MCentral_Grow(0x207838)
/usr/lib/go/src/pkg/runtime/mcentral.c:265 +0x89
runtime.MCentral_CacheSpan(0x207838)
/usr/lib/go/src/pkg/runtime/mcentral.c:84 +0x14b
runtime.MCache_Refill(0x232000, 0x2)
/usr/lib/go/src/pkg/runtime/mcache.c:78 +0x119
runtime.mallocgc(0x10, 0x0, 0x10)
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:152 +0x30e
runtime.malloc(0x10)
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:264 +0x39
runtime.mallocinit()
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:575 +0x2a5
runtime.schedinit()
/usr/lib/go/src/pkg/runtime/proc.c:150 +0x36
_rt0_go()
/usr/lib/go/src/pkg/runtime/asm_amd64.s:91 +0x114

Verbose is not working

I've tried to get a little bit more debug information because one of my qr-codes is not generating. unfortunately, the flag doesn't have any effect.

crashed on OS X 10.15.4

failed MSpanList_Insert 0x236000 0x3c6035ef49e4 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.throw(0x1ed0fb)
/usr/lib/go/src/pkg/runtime/panic.c:520 +0x69
runtime.MSpanList_Insert(0x203428, 0x236000)
/usr/lib/go/src/pkg/runtime/mheap.c:618 +0x8a
MHeap_FreeLocked(0x1ff420, 0x236000)
/usr/lib/go/src/pkg/runtime/mheap.c:447 +0x1a6
MHeap_Grow(0x1ff420, 0x10)
/usr/lib/go/src/pkg/runtime/mheap.c:341 +0x1ae
MHeap_AllocLocked(0x1ff420, 0x1, 0x2)
/usr/lib/go/src/pkg/runtime/mheap.c:222 +0x379
runtime.MHeap_Alloc(0x1ff420, 0x1, 0x10000000002)
/usr/lib/go/src/pkg/runtime/mheap.c:178 +0x7b
MCentral_Grow(0x207838)
/usr/lib/go/src/pkg/runtime/mcentral.c:265 +0x89
runtime.MCentral_CacheSpan(0x207838)
/usr/lib/go/src/pkg/runtime/mcentral.c:84 +0x14b
runtime.MCache_Refill(0x232000, 0x2)
/usr/lib/go/src/pkg/runtime/mcache.c:78 +0x119
runtime.mallocgc(0x10, 0x0, 0x10)
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:152 +0x30e
runtime.malloc(0x10)
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:264 +0x39
runtime.mallocinit()
/tmp/buildd/golang-1.3.1/src/pkg/runtime/malloc.goc:575 +0x2a5
runtime.schedinit()
/usr/lib/go/src/pkg/runtime/proc.c:150 +0x36
_rt0_go()
/usr/lib/go/src/pkg/runtime/asm_amd64.s:91 +0x114

[BUG] code.google.com/p/rsc/qr: cannot find module providing package code.google.com/p/rsc/qr

go get -u -v github.com/fumiyas/qrc/cmd/qrc
go: downloading github.com/fumiyas/qrc v0.1.1
go: downloading github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
go: downloading github.com/jessevdk/go-flags v1.5.0
go: downloading golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4
go: downloading golang.org/x/sys v0.0.0-20210521203332-0cec03c779c1
github.com/fumiyas/qrc/cmd/qrc imports
	code.google.com/p/rsc/qr: cannot find module providing package code.google.com/p/rsc/qr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.