void-bash-installer/files/bin/pinentry-chooser

23 lines
584 B
Plaintext
Raw Normal View History

2021-05-13 11:44:16 +02:00
#!/bin/sh
case $PINENTRY_USER_DATA in
tty)
exec pinentry-curses "$@"
;;
*)
if ! test -x ~/.config/pinentry; then
for i in pinentry-kwallet pinentry-qt pinentry-gnome3 pinentry-gtk-2 pinentry-emacs pinentry-dmenu pinentry-curses pinentry-tty; do
if command -v "${i}" > /dev/null; then
echo "#!/bin/sh" > ~/.config/pinentry
echo "${i} \${@}" >> ~/.config/pinentry
chmod +x ~/.config/pinentry
break
fi
done
fi
exec ~/.config/pinentry "$@"
;;
esac