qrterm

package module
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 9 Imported by: 0

README

qrterm

qrterm is terminal command that read qrcode through the ScreenCapture app for osx.

Installation

go install github.com/ysugimoto/qrterm/cmd

Or download binary from Releases page.

Usage

Before use this command, make sure your terminal is permitted of Screen Recording. Confirm your Security and Privacy setting.

Screen Shot 2022-11-11 at 9 13 25
Terminal App

Simply type qrterm command in your terminal, then runs ScreenCapture app and capture target QR Code. After captured, read QR data and open dialog.

Screen Shot 2022-11-11 at 9 18 15
Program

This package also can use in your Go program.

package main

import (
  "log"
  "github.com/ysugimoto/qrterm"
)

func main() {
  data, err := qrterm.RunProgram()
  if err != nil {
    if _, ok := err.(qrterm.ErrNotFound); ok {
      log.Println("QR Code is not found in captured image.")
      return
    }
    log.Println(err)
    return
  }
  log.Println(data)
}

Contribution

  • Fork this repository
  • Customize / Fix problem
  • Send PR :-)
  • Or feel free to create issues for us. We'll look into it

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunApp

func RunApp() error

Run as application. Display dialog and open browser

func RunProgram

func RunProgram() (string, error)

Run capture program and return read data

Types

type ErrNotFound

type ErrNotFound = gozxing.NotFoundException

re-expose NotFoundException that QR code is not found in captured image

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL