From 850195ea77c4d29364d4c5538eb3437c9758ad9c Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Tue, 23 Apr 2024 18:15:58 +0200 Subject: [PATCH] chore(gpg): improve gpg-agent command selection --- knowledge base/gnupg.md | 18 ++++++++++++++++++ snippets/gpg.fish | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/knowledge base/gnupg.md b/knowledge base/gnupg.md index bbd7181..4ce3f82 100644 --- a/knowledge base/gnupg.md +++ b/knowledge base/gnupg.md @@ -30,6 +30,22 @@ brew install --cask 'gpg-suite-no-mail' brew install 'gnupg' 'pinentry-mac' +# Launch components. +gpgconf --launch +gpgconf --launch 'gpg-agent' + +# Reload components. +gpgconf -R +gpgconf --reload 'gpg-agent' + +# Kill components. +gpgconf -K 'all' +gpgconf --kill 'gpg-agent' + +# FIXME +gpg-connect-agent updatestartuptty /bye +gpg-connect-agent reloadagent '/bye' + # List existing keys. gpg -k @@ -516,6 +532,7 @@ All the references in the [further readings] section, plus the following: - [Renew GPG key] - [Archlinux's GnuPG wiki page] - [GPG agent for SSH authentication] +- [Modify .gnupg home directories] [commonly seen problems]: https://www.gnupg.org/documentation/manuals/gnupg/Common-Problems.html +[modify .gnupg home directories]: https://www.gnupg.org/documentation/manuals/gnupg/gpgconf.html [unattended key generation]: https://www.gnupg.org/documentation/manuals/gnupg/Unattended-GPG-key-generation.html diff --git a/snippets/gpg.fish b/snippets/gpg.fish index e4702c6..735e17a 100644 --- a/snippets/gpg.fish +++ b/snippets/gpg.fish @@ -2,6 +2,7 @@ gpg-connect-agent reloadagent '/bye' -gpg-connect-agent updatestartuptty '/bye' \ +gpgconf --launch gpg-agent \ +&& gpg-connect-agent updatestartuptty '/bye' \ && set -x 'SSH_AUTH_SOCK' (gpgconf --list-dirs 'agent-ssh-socket') \ && set -x 'GPG_TTY' (tty)