Skip to content

Instantly share code, notes, and snippets.

@stefanszymanski
Last active April 15, 2023 14:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanszymanski/4e6e98fe59719307841f9acd56ee1cd7 to your computer and use it in GitHub Desktop.
Save stefanszymanski/4e6e98fe59719307841f9acd56ee1cd7 to your computer and use it in GitHub Desktop.
Pinentry wrapper

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment