diff options
author | EuAndreh <eu@euandre.org> | 2022-08-16 19:32:27 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-08-16 19:32:44 -0300 |
commit | 9f8e9ca03f7e7a6512a6429c063a7cabafb98293 (patch) | |
tree | a49b35b7e5d902185738b30be12e24e365202aa0 /bin | |
parent | bin/lines: Add working version (diff) | |
download | dotfiles-9f8e9ca03f7e7a6512a6429c063a7cabafb98293.tar.gz dotfiles-9f8e9ca03f7e7a6512a6429c063a7cabafb98293.tar.xz |
bin/menu: Implement "yubikey" ACTION using ykman
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/menu | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -100,8 +100,8 @@ case "$ACTION" in CHOICE="$(pass_list | show 'username')" if [ -n "$CHOICE" ]; then if pass show -c2 "$CHOICE"; then - notify-send -t 5000 -u normal -- "$CHOICE" \ - 'username copied to clipboard' + notify-send -t 5000 -u normal -- \ + "$CHOICE" 'username copied to clipboard' fi fi ;; @@ -111,8 +111,8 @@ case "$ACTION" in echo trap 'clipctl enable' EXIT # FIXME echo clipctl disable if pass show -c1 "$CHOICE"; then - notify-send -t 5000 -u critical -- "$CHOICE" \ - 'password copied to clipboard' + notify-send -t 5000 -u critical -- \ + "$CHOICE" 'password copied to clipboard' fi fi ;; @@ -123,8 +123,14 @@ case "$ACTION" in clipmgr -l | show 'clipboard' | copy ;; yubikey) - echo 'yubikey-oath-dmenu' # FIXME - exit 2 + CHOICE="$(ykman oath accounts list | show 'OTP')" + if [ -n "$CHOICE" ]; then + ykman oath accounts code "$CHOICE" | + awk '{ print $(NF) }' | + copy -n + notify-send -t 5000 -u critical -- \ + "$CHOICE" 'code copied to clipboard' + fi ;; *) printf 'Bad ACTION: %s.\n\n' "$ACTION" >&2 |