Saturday, August 30, 2025

Starting X Server on Debian with systemd, xfce and lightdm

I have been reading about X server keyboard configuration and this lead me to wonder how the X server was started, with what arguments and configuration files, resulting in what keyboard configuration.

There are many posts that describe how to run X, xfce and lightdm but they are almost all in terms of what packages to install or reconfigure before rebooting. None that I found explain what configuration those packages create or the process of booting to bring up the X server and 'greeter' for login.

So I investigated the lightdm source code, finally coming to the following conclusions:

The lightdm package includes a lightdm systemd service which is started at boot, to run the lightdm executable.

The lightdm executable starts the X server: /usr/lib/xorg/Xorg.

After starting the X server, lightdm must start the greeter, which is provided by a separate package. Presumably it is a separate executable that creates windows on the display managed by the X server. But I didn't look for the code that does this.

I still don't know how the session setup after authentication is done but I expect that this can change the keyboard layout. It would be strange if different users were not able to use different keyboard layouts. One might prefer qwerty US English and another dvorak or French or German or whatever. That is, the keyboard layout should configurable as a per-user preference: optionally overriding the system default.

The Xorg command line does not specify the keyboard layout. The layout appears to be specified in /etc/X11/xorg.conf.d/00-keyboard.conf. At least, this seems plausible. I haven't edited it to confirm that it makes a difference or found evidence in logs that it did determine the layout.

There are still many unknowns and uncertain guesses, but I am happy enough with these conclusions to get back to investigation of the keyboard layout itself.

No comments:

Post a Comment