mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-12-11 09:22:02 +01:00
20 lines
456 B
Bash
20 lines
456 B
Bash
|
|
||
|
password_list="$(emacs -Q --batch --eval $'(progn (require \'server) (princ (format "%s\n" (server-eval-at "server" \'(string-join (password-store-list) "\n")))))')"
|
||
|
password="$(echo "$password_list" | emacs-rofi "password: " 90 30)"
|
||
|
|
||
|
if [[ "$password" == "nil" ]] ; then
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
case $1 in
|
||
|
"copy")
|
||
|
pass -c "$password"
|
||
|
;;
|
||
|
"qr")
|
||
|
alacritty -e sh -c "echo \"waiting for yubikey\" ; pass -q $password ; read"
|
||
|
;;
|
||
|
*)
|
||
|
echo error
|
||
|
;;
|
||
|
esac
|