mirror of
https://github.com/stumpwm/stumpwm-contrib.git
synced 2026-09-10 07:26:25 -04:00
This is a small module which allows to get TOTP code from yubikey and add a new one via capture QR code.
1.3 KiB
1.3 KiB
Requirements
- cl-ppcre
- ykman (Yubikey Manager CLI)
- xclip
- maim (for QR capture)
- zbarimg (for QR decoding)
Install cl-ppcre from the REPL:
(ql:quickload :cl-ppcre)
Install system dependencies (OpenBSD):
pkg_add yubikey-manager xclip maim zbar
Usage
This module provides commands for managing OATH TOTP accounts on a Yubikey.
Put the following in your ~/.stumpwmrc:
(load-module "swm-ykman")
Define keybindings:
(define-key *root-map* (kbd "y") "swm-ykman-totp")
(define-key *root-map* (kbd "Y") "swm-ykman-add-qr")
Commands
swm-ykman-totp
Opens a menu to select an OATH account from your Yubikey. The TOTP code is generated and copied to the clipboard.
swm-ykman-add-qr
Allows you to select a screen region containing a QR code (using maim). The QR code is decoded and the OATH account is added to your Yubikey.
If the account already exists, you will be prompted to:
- Overwrite the existing account
- Save with a different name
- Cancel the operation
Variables
swm-ykman-xclip-selection
X selection to use for clipboard operations. Default is "clipboard".
Can also be "primary" for middle-click paste.
(setf swm-ykman:*swm-ykman-xclip-selection* "primary")