add lastpass, yubikey and emoji selecting

This commit is contained in:
Felix Van der Jeugt 2022-05-09 17:18:15 +02:00
parent 36c6328a8a
commit 3a49dc3ba7

View File

@ -22,7 +22,8 @@ fi
choice="$(pick <<HERE choice="$(pick <<HERE
email address email address
password pass
lpass
clipboard clipboard
selection selection
run run
@ -30,6 +31,8 @@ otp
student student
curl curl
clipmenu clipmenu
yubikey
emoji
HERE HERE
)" )"
@ -38,10 +41,14 @@ case "$choice" in
choice="$(khard email -p --remove-first-line | sed 's/\(.*\)\t\(.*\)\t\(.*\)/\2 <\1>/' | pick)" choice="$(khard email -p --remove-first-line | sed 's/\(.*\)\t\(.*\)\t\(.*\)/\2 <\1>/' | pick)"
inject "$choice" inject "$choice"
;; ;;
'password') 'pass')
choice="$(cd ~/.password-store; find * -name '*.gpg' | sed 's/\.gpg$//' | sort -d | pick)" choice="$(cd ~/.password-store; find * -name '*.gpg' | sed 's/\.gpg$//' | sort -d | pick)"
inject "$(pass show "$choice" | head -1)" inject "$(pass show "$choice" | head -1)"
;; ;;
'lpass')
choice="$(lpass ls --format '%an' --color=never | grep -v '^$' | pick)"
inject "$(lpass show --password "$choice" | head -1)"
;;
'clipboard') 'clipboard')
inject "$(xclip -o -sel c)" inject "$(xclip -o -sel c)"
;; ;;
@ -70,4 +77,12 @@ case "$choice" in
'clipmenu') 'clipmenu')
exec clipmenu exec clipmenu
;; ;;
'yubikey')
choice="$(ykman oath accounts list | pick)"
inject "$(ykman oath accounts code -s "$choice")"
;;
'emoji')
choice="$(uni emoji all -f '%(name), %(cldr_full), %(emoji)' | awk -F', ' '{ i=1; while($i != $NF && $i != "") { print($i, $NF); i++ }}' | pick)"
inject "${choice##* }"
;;
esac esac