summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gnupg/gpg-agent.conf2
-rwxr-xr-x.gnupg/pinentry-wrapper16
-rw-r--r--README.md2
3 files changed, 19 insertions, 1 deletions
diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf
index 6993c89..93d7907 100644
--- a/.gnupg/gpg-agent.conf
+++ b/.gnupg/gpg-agent.conf
@@ -1,4 +1,4 @@
-pinentry-program /usr/local/bin/pinentry-tty
+pinentry-program /usr/local/bin/pinentry-wrapper
default-cache-ttl 3600
default-cache-ttl-ssh 3600
max-cache-ttl 3600
diff --git a/.gnupg/pinentry-wrapper b/.gnupg/pinentry-wrapper
new file mode 100755
index 0000000..229ad94
--- /dev/null
+++ b/.gnupg/pinentry-wrapper
@@ -0,0 +1,16 @@
+#!/bin/sh
+# TAKEN FROM https://unix.stackexchange.com/a/236747/135796
+# choose pinentry depending on PINENTRY_USER_DATA
+# requires pinentry-curses and pinentry-tty
+# this *only works* with gpg 2
+# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802020
+# Fixes the pinentry-tty error https://github.com/neomutt/neomutt/issues/1014
+
+case $PINENTRY_USER_DATA in
+ curses)
+ exec /usr/local/bin/pinentry-curses "$@"
+ ;;
+ *)
+ exec /usr/local/bin/pinentry-tty "$@"
+ ;;
+esac
diff --git a/README.md b/README.md
index e9c1d9e..0304836 100644
--- a/README.md
+++ b/README.md
@@ -26,6 +26,7 @@ sudo apt install scdaemon vim htop tmux pass pass-extension-otp git-crypt pinent
ln -sf ~/.rc/.bashrc ~/.bashrc
sudo ln -sf /usr/bin/pinentry-tty /usr/local/bin/pinentry-tty
+sudo ln -sf /usr/bin/pinentry-curses /usr/local/bin/pinentry-curses
ln -sf ~/.rc/.gnupg/gpg.conf ~/.gnupg/gpg.conf
```
@@ -63,6 +64,7 @@ git remote add origin [email protected]:~a14m/.rc
```bash
mkdir -p ~/.gnupg
chmod 700 ~/.gnupg
+sudo ln -sf ~/.rc/.gnupg/pinentry-wrapper /usr/local/bin/pinentry-wrapper
ln -sf ~/.rc/.gnupg/gpg-agent.conf ~/.gnupg/gpg-agent.conf
ln -sf ~/.rc/.gnupg/sshcontrol ~/.gnupg/sshcontrol