commit 2a5662ee542b1674bd828bfc51a97d6fe6a9686c
parent cda8f591b82aeab70e1d33460612c78357d48a8d
Author: Chris Bracken <chris@bracken.jp>
Date: Fri, 13 Oct 2023 17:01:49 -0700
Simplify SSH_AUTH_SOCK setting on Linux
We now just hardcode it. It would be nice if there were a way to read
this from systemctl, but it doesn't seem to work with my current
dotfiles.
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile
@@ -5,9 +5,7 @@ if [[ -x /usr/bin/resizewin ]]; then /usr/bin/resizewin -z; fi
if [[ "$(uname)" == "Linux" && -z "$SSH_AUTH_SOCK" ]]; then
# ssh-agent is started by systemd; add the socket path to the environment.
- SOCK_VAR="$(systemctl --user show-environment | grep '^SSH_AUTH_SOCK=')"
- [ ! -z "$SOCK_VAR" ] && export "$SOCK_VAR"
- unset SOCK_VAR
+ export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
elif [[ "$(uname)" == "FreeBSD" ]]; then
# Start ssh-agent daemon.
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"