dmenu interface for getting OATH codes from a YubiKey
This program lets you pick an OATH credential from your YubiKey using dmenu, and copies the corresponding OTP to the clipboard using xclip. Alternatively, it can "type" the OTP using xdotool.
Notable features:
- Pick between all credentials on all connected YubiKeys
- No mouse interaction required
Invoke with --help
to see the command line options.
$ yubikey-oath-dmenu --help
Recommended usage is to map your preferred command line to a shortcut in your window manager or desktop environment. For example, you could bind it to Super+o and Super+Shift+o in i3wm like this:
# Grab OTPs from ykman oath
bindsym $mod+o exec yubikey-oath-dmenu --notify --clipboard clipboard
bindsym $mod+Shift+o exec yubikey-oath-dmenu --notify --type
- Python 3
- Click
- dmenu
- xclip
- YubiKey Manager Python library, version 0.5.0 or later.
Optional dependencies:
-
Arch Linux: AUR package
-
Others: Place
yubikey-oath-dmenu.py
with executable mode somewhere on your$PATH
./usr/local/bin/
probably works, for example. The included Makefile provides targets for this:# make install install -D -m755 "yubikey-oath-dmenu.py" "/usr/local/bin/yubikey-oath-dmenu" # make uninstall rm "/usr/local/bin/yubikey-oath-dmenu"
Both targets respect the standard
DESTDIR
andPREFIX
variables:$ make DESTDIR=/tmp/yubikey-oath-dmenu PREFIX=/usr install install -D -m755 "yubikey-oath-dmenu.py" "/tmp/yubikey-oath-dmenu/usr/bin/yubikey-oath-dmenu"
Big thanks to our contributors: