dmenu interface for getting OATH codes from a YubiKey
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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


Optional dependencies:

  • libnotify: For the --notify option, which uses notify-send
  • xdotool: For the --type option


  • Arch Linux: AUR package

  • Others: Place 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 "" "/usr/local/bin/yubikey-oath-dmenu"
    # make uninstall
    rm "/usr/local/bin/yubikey-oath-dmenu"

    Both targets respect the standard DESTDIR and PREFIX variables:

    $ make DESTDIR=/tmp/yubikey-oath-dmenu PREFIX=/usr install
    install -D -m755 "" "/tmp/yubikey-oath-dmenu/usr/bin/yubikey-oath-dmenu"


Big thanks to our contributors: