From e679f41745fe698fba0dfde48b01f82c8c0ffd60 Mon Sep 17 00:00:00 2001 From: Andrew Davidson Date: Tue, 5 Nov 2019 20:28:50 -0500 Subject: [PATCH] adding gnupg to dotfiles\n fixes pinentry issues --- gnupg/.gnupg/gpg-agent.conf | 3 +++ gnupg/bin/pinentry-smart | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 gnupg/.gnupg/gpg-agent.conf create mode 100755 gnupg/bin/pinentry-smart 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