“qrcode-elisp” is Emacs elisp package for QRCode generating and decoding.
It containts the features:
- generating QRCode from text to image.
- decoding the QRCode image (or from clipboard) to text.
- generate QR code by using the command “qrcode-elisp-generate-qrcode”
- decode QR code from image of clipboard by using the command “qrcode-elisp-decode-qrcode-from-clipboard”
Please intall Python https://www.python.org/ and Pip, and “python3” is preferred.
- 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"))) )
- Set python command for your system
;; for Linux (setq qrcode-elisp-python-command "python3") ;; for win10 ;; (setq qrcode-elisp-python-command "py")
- 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)
Command | Usage | |
---|---|---|
qrcode-elisp-generate-qrcode | suggested to use | Generate 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-open | As same as qrcode-elisp-generate-qrcode , but show the image directly. | |
qrcode-elisp-decode-qrcode-from-clipboard | suggested to use | Decode the QRCode image from clipboard, and output the result to the buffer ”QR Code” in org-mode |
qrcode-elisp-decode-qrcode-from-image | Decode the QRCode image from clipboard, and return the text directly (show in minibuffer). | |
qrcode-elisp-install-enviroment | Install the python packages required by this package. |
variable | Usage |
---|---|
qrcode-elisp-python-command | The python command in the system |