leuven65 / qrcode-elisp

Integrate QRCode generating and decoding to Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qrcode-elisp

About

“qrcode-elisp” is Emacs elisp package for QRCode generating and decoding.

It containts the features:

  1. generating QRCode from text to image.
  2. decoding the QRCode image (or from clipboard) to text.

Snapshot

  1. generate QR code by using the command “qrcode-elisp-generate-qrcode”

    image/About/2020-12-26_17-08-01_screenshot.png

    image/About/2020-12-26_17-07-32_screenshot.png

  2. decode QR code from image of clipboard by using the command “qrcode-elisp-decode-qrcode-from-clipboard”

    image/About/2020-12-26_17-09-50_screenshot.png

Installation

pre-require

Please intall Python https://www.python.org/ and Pip, and “python3” is preferred.

install

  1. Clone this git repo to “${user-emacs-directory}/packages/qrcode-elisp”, and add folowing lines to your Emacs config file:
    (use-package qrcode-elisp
      :defer t
      :ensure nil ; it is github package
      ;; If the path is relative, it is expanded within `user-emacs-directory'
      :load-path "packages/qrcode-elisp"
      ;; :custom
      ;; (qrcode-elisp-python-command "python3")
      ;; (qrcode-elisp-text-coding 'gb2312)
      :init
      (let ((pkg-name "qrcode-elisp"))
        (ignore-errors
          (package-generate-autoloads pkg-name
                                      (expand-file-name (concat "packages/" pkg-name)
                                                        user-emacs-directory)))
        (load (concat pkg-name "-autoloads.el")))
      )
        
  2. Set python command for your system
    ;; for Linux
    (setq qrcode-elisp-python-command "python3")
    ;; for win10
    ;; (setq qrcode-elisp-python-command "py")
        
  3. In “M-x”, run the command ”qrcode-elisp-install-enviroment”.
    it will install the python package “qrcode” for qrcode generating, “pyzbar” for qrcode decoding, and “pillow” for copying image from system clipboard.
    (qrcode-elisp-install-enviroment)
        

Usage

Commands provided by this package:

CommandUsage
qrcode-elisp-generate-qrcodesuggested to useGenerate QRCode from current active region or user input, and show the generated image in the buffer ”QR Code” in org-mode
qrcode-elisp-generate-qrcode-and-openAs same as qrcode-elisp-generate-qrcode, but show the image directly.
qrcode-elisp-decode-qrcode-from-clipboardsuggested to useDecode the QRCode image from clipboard, and output the result to the buffer ”QR Code” in org-mode
qrcode-elisp-decode-qrcode-from-imageDecode the QRCode image from clipboard, and return the text directly (show in minibuffer).
qrcode-elisp-install-enviromentInstall the python packages required by this package.

variables

variableUsage
qrcode-elisp-python-commandThe python command in the system

About

Integrate QRCode generating and decoding to Emacs


Languages

Language:Emacs Lisp 100.0%