From 98d42bd113e983e27104512b614ff7bec5d237f7 Mon Sep 17 00:00:00 2001 From: Alexander Oakman Date: Sat, 20 Jul 2024 01:04:43 +0300 Subject: [PATCH] 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. --- usr/bin/start-sway | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr/bin/start-sway b/usr/bin/start-sway index 69d26c0..2b6c3f3 100755 --- a/usr/bin/start-sway +++ b/usr/bin/start-sway @@ -47,9 +47,14 @@ if [ -d "${XDG_CONFIG_HOME:-$HOME/.config}/environment.d" ]; then set +o allexport 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 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 - exec systemd-cat -- /usr/bin/sway $@ + run_sway fi