Skip to content

Instantly share code, notes, and snippets.

@ottidmes
Created December 2, 2018 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottidmes/e9e328807acc40a14712c64a078c85b6 to your computer and use it in GitHub Desktop.
Save ottidmes/e9e328807acc40a14712c64a078c85b6 to your computer and use it in GitHub Desktop.
{
# The script uses either the CLI or GUI program depending on being in a shell or not.
environment.interactiveShellInit = "export PINENTRY_USER_DATA=$TTY";
}
#!/usr/bin/env bash
# http://unix.stackexchange.com/questions/236746/change-pinentry-program-temporarily-with-gpg-agent
# https://github.com/keybase/keybase-issues/issues/1099#issuecomment-59313502
if [[ -z $PINENTRY_USER_DATA ]]; then
exec pinentry-gtk-2 "$@"
else
exec pinentry-curses --ttyname "$PINENTRY_USER_DATA" "$@"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment