I've reworked sys.xsession and factored out all services to scriptlets which live in /etc/X11/xdm/scripts. These scriptlets are ordered and should be sourced as they need to build a command line which gets exec'ed. I've taken Werner's latest suggestions for the gpg-agent scriptlet with minor changes [*]. It was a bit tricky to detangle ssh-agent and gpg-agent, I had to move the ssh-agent settings variables to a different scriptlet which gets run before the gpg-agent one as the latter may modify the ssh settings. I don't want to ship any of the script files in /etc/X11/xdm/scripts with xdm. All these files should be moved to the package providing the respective service. You can find the modified xdm package in home:eeich:branches:X11:XOrg/xdm on OBS. [*] These have received only minimal testing and are only meant as a base line for modifications.