Generate QR codes via a key binding

This commit is contained in:
Ohad Livne 2025-06-04 22:46:49 +03:00
parent 46f7a13058
commit 940261786a
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D

View file

@ -295,3 +295,15 @@ When DEBUG is set, run the test in the debugger."
(emms-player-list '(emms-player-mpv))
; keep-sorted end
)
(defun my-qr-selection ()
(interactive)
(if (use-region-p)
(qrencode-region (region-beginning) (region-end))
(let ((url (thing-at-point-url-at-point)))
(if (null url)
(call-interactively #'qrencode-string)
(qrencode--encode-to-buffer url)))))
(use-package qrencode
:bind (("C-z q" . my-qr-selection)))