diff --git a/gnupg/.gnupg/gpg-agent.conf b/gnupg/.gnupg/gpg-agent.conf new file mode 100644 index 0000000..cf182b0 --- /dev/null +++ b/gnupg/.gnupg/gpg-agent.conf @@ -0,0 +1,3 @@ +pinentry-program ~/bin/pinentry-smart +default-cache-ttl 600 +max-cache-ttl 7200 diff --git a/gnupg/bin/pinentry-smart b/gnupg/bin/pinentry-smart new file mode 100755 index 0000000..7dd48f2 --- /dev/null +++ b/gnupg/bin/pinentry-smart @@ -0,0 +1,12 @@ +#!/bin/sh + +set -eu + +PINENTRY_TUI='/usr/bin/pinentry-curses' +PINENTRY_GUI='/usr/bin/pinentry-gnome3' + +if [ -n "${DISPLAY-}" -a -z "${TERM-}" ]; then + exec "$PINENTRY_GUI" "$@" +else + exec "$PINENTRY_TUI" "$@" +fi