commit 7a4a5a5abb0583a9571faea2da853aa0cec8f50e parent 3cae7d624951d31cc84eecbe79e74dd84538c8f1 Author: Chris Bracken <chris@bracken.jp> Date: Mon, 26 Aug 2024 22:11:27 -0700 gpg: add OS-specific pinentry handling Diffstat:
M | .gnupg/gpg-agent.conf | | | 3 | +++ |
A | .local/bin/pinentry-os-specific | | | 8 | ++++++++ |
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/.gnupg/gpg-agent.conf b/.gnupg/gpg-agent.conf @@ -1,3 +1,6 @@ # Override default PIN timeout from 10 mins with a max of 2 hours, to 12 hours. max-cache-ttl 43200 default-cache-ttl 43200 + +# Use script to switch between OS-specific pinentry programs. +pinentry-program ~/.local/bin/pinentry-os-specific diff --git a/.local/bin/pinentry-os-specific b/.local/bin/pinentry-os-specific @@ -0,0 +1,8 @@ +#!/bin/zsh + +PINENTRY=pinentry +if [[ "$(uname)" == "Darwin" ]] && command -v "$(brew --prefix)/bin/pinentry-mac" &> /dev/null; then + PINENTRY="$(brew --prefix)/bin/pinentry-mac" +fi + +$PINENTRY