dotfiles/home-manager/modules/xmonad/scripts/passmenu.sh

20 lines
456 B
Bash
Raw Normal View History

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