I started using this script as pinentry-program
in my gpg-agent.conf
when I wanted pass (https://www.passwordstore.org/)
to work in qutebrowser.
I saved it as /usr/bin/pinentry-auto
and always start qutebrowser with PINENTRY_USER_DATA=gtk qutebrowser
.
#!/bin/bash
case $PINENTRY_USER_DATA in
gtk) exec /usr/bin/pinentry-dmenu "$@" ;;
none) exit 1 ;;
*) exec /usr/bin/pinentry-tty "$@" ;;
esac
Don't forget to make it executable: sudo chmod ugo+x /usr/bin/pinentry-auto
See also: