chiark / gitweb /
gpg: Fix searching for mail addresses in keyrings.
[gnupg2.git] / debian / Xsession.d / 90gpg-agent
1 # On systems with systemd running, we expect the agent to be launched
2 # via systemd's user mode (see
3 # /usr/lib/systemd/user/gpg-agent.{socket,service} and
4 # systemd.unit(5)).  This allows systemd to clean up the agent
5 # automatically at logout.
6
7 # If systemd is absent from your system, or you do not permit it to
8 # run in user mode, then you may need to manually launch gpg-agent
9 # from your session initialization with something like "gpgconf
10 # --launch gpg-agent"
11
12 # Nonetheless, ssh and older versions of gpg require environment
13 # variables to be set in order to find the agent, so we will set those
14 # here.
15
16 agent_sock=$(gpgconf --list-dirs agent-socket)
17 export GPG_AGENT_INFO=${agent_sock}:0:1
18 if [ -n "$(gpgconf --list-options gpg-agent | \
19       awk -F: '/^enable-ssh-support:/{ print $10 }')" ]; then
20     export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
21 fi
22