From 984cbd1447f3ad97de5c69e74eeb764efde4e64f Mon Sep 17 00:00:00 2001 From: Giovanni Bassi Date: Sat, 25 May 2024 20:08:48 -0300 Subject: [PATCH] Check if gpg-agent service is enabled for ssh --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 368d361..f71bc72 100755 --- a/.bashrc +++ b/.bashrc @@ -130,7 +130,7 @@ if $WSL; then # forward ssh socket to Windows export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/ssh.sock" else - if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ]; then + if [ -S "$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" ] || systemctl --user is-enabled gpg-agent-ssh.socket -q &> /dev/null; then # forward ssh socket to gpg export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh" elif ! [ -v SSH_AUTH_SOCK ]; then