Hi folks, Perhaps the solution might involve using systemd's environment-generators [1]. This seems to be the new preferred way to set environmental variables like SSH_AUTH_SOCK and the replacement for putting scripts in /etc/X11/Xsession.d/.
For example the gnupg-agent package could create the file /usr/lib/systemd/user-environment-generators/90gpg-agent containing something like this: #!/bin/bash if [ -n "$(gpgconf --list-options gpg-agent | \ awk -F: '/^enable-ssh-support:/{ print $10 }')" ]; then echo SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) fi This is what I'm using at the moment and it seems to work well. What do you think? --rufo [1] https://www.freedesktop.org/software/systemd/man/systemd.environment-generator.html