From 9f383c9cf3543007d876684bdcea2b4f1a98a520 Mon Sep 17 00:00:00 2001 From: Daniel Borchmann Date: Sat, 26 Feb 2022 16:33:41 +0100 Subject: [PATCH] Use own instance of ssh-agent when starting a new Xsession --- xsessionrc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) mode change 100644 => 100755 xsessionrc diff --git a/xsessionrc b/xsessionrc old mode 100644 new mode 100755 index d9d4acb..6fc7f31 --- a/xsessionrc +++ b/xsessionrc @@ -1,3 +1,17 @@ #!/bin/sh -. $HOME/.profile +. "$HOME/.profile" + +# Xsession will start it's own versio nof ssh-agent, but we want to use ours; +# setting SSH_AUTH_AUTH will prevent Xsession from starting it's own instance of +# ssh-agent. + +systemctl --user start ssh-agent.service + +SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" # can this be retrieved + # directly from + # ssh-agent.service? +export SSH_AUTH_SOCK + +SSH_AGENT_PID="$(systemctl --user show -p MainPID --value ssh-agent)" +export SSH_AGENT_PID