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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitattributes
LICENSE
Makefile
NEWS.md
README.md
compute-version.sh
lgtm.yml
release.sh
set-version.sh
yubikey-oath-dmenu.py

README.md

yubikey-oath-dmenu

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

Usage

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

Dependencies

Optional dependencies:

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

Installation

  • 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 and PREFIX 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"
    

Contributors

Big thanks to our contributors: