dotfiles/home-manager/modules/xmonad/scripts/passmenu.sh
magic_rb c1684d5203
Add a password menu
Signed-off-by: magic_rb <magic_rb@redalder.org>
2024-02-23 21:13:41 +01:00

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