Desktop Environment Components | Linux

The sequence of launching the components of the kde-plasma graphical session: It all starts with the fact that the same process of system initialization is launched in user space with pid=1. Now this process is called systemdbut still, in many systems you will see in the list of processes an instance with the name initwhich is a symbolic link to the systemd executable.

Untitled

init

Now, to understand how the graphical environment starts, you only need to know that this process starts a pull of programs at the system initialization stage, including, it starts the display manager, more precisely, it starts the service display-manager.service, which in turn launches the display manager executable. The main paths along which the services lie: “/etc/systemd/system” “/run/systemd/system” “/lib/systemd/system“. For the kde-plasma environment, the standard dm is sddm. When installing the package, the service of this display manager will go to the directory /lib/systemd/system. In fact “/etc/systemd/system/display-manager.service” is just a symbolic link to the service of the current main dm. Accordingly, systemd, when starting the display manager, will work with the service that lies in /lib/systemd/system – services that are provided by packages after installation are written to this directory – in our case, systemd will process /lib/systemd/system/sddm.servicewhich, if you look inside, will launch /usr/bin/sddm.

Untitled

display-manager.service

Untitled

sddm.service

After launch, in order to display the interface to the user, sddm runs Xorg a server, roughly speaking, is an application that implements interaction with clients using the X protocol. For example, in order to display a window, the client application must call the method XMapWindow,The Xorg server accepts the request, accesses the graphics ,hardware and displays the image on the screen. This is a fairly basic explanation of how the X windowing system is implemented – the overall presentation of its components looks quite complex and deserves a detailed analysis in a separate article.

Untitled

Structure X Window System

After the user has successfully identified himself and selected the plasma desktop environment, sddmdepending on the session type X11/Waylandwill launch either startplasma-x11or startplasma-wayland. This process begins the initialization of the user session: global environment variables are set, a set of key services for the session is launched via dbus and applications from the autostart directories. If systemd is not running, or the necessary targets are missing (units that allow you to run services in groups), startplasma-x11 starts the process plasma-sessionwhich is a fallback and runs applications without being tied to the systemd manager.

Untitled

startplasma.cpp

Untitled

Process launch tree

Next, after plasma has decided on how to form the backbone of our session, applications and services are launched directly. For applications from autostart directories, priority is taken into account. In .desktop files you can specify the phase in which it will be launched. There is a variable for this in kde-plasma X-KDE-autostart-phase. Indexing goes from 0 to 2. The application with the most recent index will be launched last. Specifying launch priority can be useful when there is communication between applications (IPC). At this stage of the system startup, applications such as the window manager (kwin), shell (plasmashell), session manager (ksmserver), notification service, daemon (kded5) and so on are launched: you can see a list of all running processes with a demonstration of nesting using the command “ps-axjf“. Once everything is ready, you finally log into the session, see the desktop and all its graphical components.

Phew, this is probably the end of our general introduction to what the “Russian average” desktop environment consists of. I hope you learned something new and can use the system a little more confidently. If I made a mistake somewhere in the technical explanations, feel free to correct me.

We'll hear you in the next articles!

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *