Pass SSH_AUTH_SOCK env to all processes in the session

As stated in the ssh-agent manual, running desktop-manager as a fork of ssh-agent
is a possible way to configure the agent and pass its socket to all underlying processes.
A similar trick is used in LMDE.
This commit is contained in:
Alexander Oakman 2024-07-20 01:04:43 +03:00
parent 836e378d5a
commit 98d42bd113

View file

@ -47,9 +47,14 @@ if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d" ]; then
set +o allexport set +o allexport
fi fi
# Run Sway under ssh-agent
run_sway() {
exec systemd-cat -- /usr/bin/ssh-agent /usr/bin/sway $@
}
# Check if Nvidia driver installed, start Sway and send output to the journal # Check if Nvidia driver installed, start Sway and send output to the journal
if [ -d /sys/module/nvidia ] && [ ! -d /sys/module/amdgpu ] && [ ! -d /sys/module/i915 ]; then if [ -d /sys/module/nvidia ] && [ ! -d /sys/module/amdgpu ] && [ ! -d /sys/module/i915 ]; then
exec systemd-cat -- /usr/bin/sway --unsupported-gpu $@ run_sway --unsupported-gpu $@
else else
exec systemd-cat -- /usr/bin/sway $@ run_sway
fi fi