YubiKey OATH integration for Rofi
- ykman
- Rofi
- Bash
- xclip for X11 clipboard support (optional)
- xdotool for X11 typing support (optional)
- wl-clipboard for Wayland clipboard support (optional)
- wtype for Wayland typing support (optional)
- libnotify and a suitable notification server for showing notifications (optional)
Usage: rofi-ykman [command]
Commands:
clipboard Copy the code to the clipboard (default).
type Type the code.
When selecting an an entry, the code will by copied to the clipboard or typed, depending on the selected command. Alternatively, you can use one of the shortcuts to choose a different command dynamically:
Shortcut | Command |
---|---|
Alt+1 |
type |
Alt+2 |
clipboard |
Assuming you have copied this script to ~/.config/rofi/rofi-ykman
, add this to your i3 or Sway config:
bindsym --release $mod+o exec --no-startup-id "~/.config/rofi/rofi-ykman"
When you press $mod+o
, you will see a Rofi prompt listing available TOTP accounts. Choose one and the code will be copied to your clipboard. If you forgot to insert YubiKey, you'll get a notification saying so.
You are of course free to put the script in a different location or use a different keybinding.