How graphics work in Linux: an overview of the various desktop environments

This article is about how Linux graphics work and what components it consists of. It has many screenshots of various implementations of desktop environments. 

If you don't know much about KDE and GNOME, or if you do, but would like to know what other alternatives are, then this article is for you. It is an overview, and although it has many names and few terms, the material will also be useful for beginners and just looking towards Linux.

The topic may also be of interest to advanced users when setting up remote access and when implementing a thin client. I often meet quite seasoned Linuxoids with the statements “on the server there is only a command line, and I don’t plan to study the graphics in more detail, since this is all necessary for ordinary users.” But even Linux connoisseurs are surprised and happy to discover the "-X" option for the ssh command (and for this it is useful to understand the operation and functions of the X server).

How graphics work in Linux: an overview of the various desktop environmentsSource

I have been teaching Linux courses for almost 15 years at "Network Academy LANIT”And I’m sure that many of those more than five thousand people whom I trained read and probably write articles on Habr. The courses are always very busy (the average duration of the course is five days), you need to talk about topics that require at least ten days for a full acquaintance. And always during the course, depending on the audience (newbies gathered or seasoned administrators), as well as "questions from the audience", I make a choice of what to convey in more detail and what is more superficial in order to devote more time to command line utilities and their practical application . There are enough such topics that have to be sacrificed a little. These are “History of Linux”, “Differences in Linux distributions”, “About licenses: GPL, BSD, …”, “About graphics and desktop environments” (the topic of this article), etc. Not that they are not important, but usually there are many more relevant “here and now” questions and only some five days ... However, for a general understanding of the basics of the Linux OS, an understanding of the diversity available (so that even using one specific Linux distribution, still have a broader view of all this huge and the vast world that is called "Linux") it is useful and necessary to study these topics. 

Throughout the article, for each component, I indicate links for those who want to dive deeper into the topic, for example, to Wikipedia articles (while pointing to a more complete / useful version if there are English and Russian articles).

For basic examples and screenshots, I used the openSUSE distribution. It was possible to use any other community developed distribution with a large number of packages in the repository. It is difficult, but possible, to demonstrate the variety of desktop designs on a commercial distribution, as they often use only one or two of the more well-known desktop environments. So developers narrow down the task of releasing a stable, debugged OS. On the same system, I installed all DM / DE / WM (an explanation of these terms below), which I found in the repository. 

Screenshots with "blue frames" are just taken on openSUSE. 

Screenshots with "white frames" were made on other distributions, they are indicated in the screenshot. 

Screenshots with "gray borders" were taken from the Internet, as examples of desktop designs from yesteryear.

So, let's begin.

The main components that make up graphics

I will single out three main components and list them in the order in which they are launched at system startup: 

  1. DM (Display Manager);
  2. display server;
  3. DE (Desktop Environment).

Additionally, as important sub-items of the Desktop Environment: 

  • Apps Manager/Launcher/Switcher (Start button); 
  • WM (Window Manager);
  • various software that comes with the desktop environment.

More details on each item.

DM (Display Manager)

The first application that starts when "graphics" starts is DM (Display Manager), a display manager. Its main tasks:

  • ask which users to let into the system, request authentication data (password, fingerprint);
  • choose which desktop environment to run.

Currently, various distributions are widely used: 

The list of existing DMs is kept up to date in Wiki article. 

How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
It is worth noting that the following screenshots use the same LightDM display manager, but in different distributions (distribution names are in parentheses). Check out how different this DM can look thanks to the work of the designers of different distributions.

How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
The main thing in this diversity is to make it clear that there is an application that is responsible for launching graphics and allowing the user to access these graphics, and there are different implementations of this application that differ in appearance and some functionality (choice of design environments, choice of users, version for bad seeing users, the possibility of remote access via the protocol XDMCP).

Display Server

Display Server is a kind of graphics foundation, the main task of which is to work with a video card, a monitor, and with various input devices (keyboard, mouse, touchpads). That is, an application (for example, a browser or a text editor) that is rendered in a “graphics” does not need to know how to work with devices directly, it does not need to know about drivers. It's all taken care of by the X Window.

When talking about Display Server, for many years in Linux, and in Unix, it meant an application X Window System or in the common people X (X). 

Now many distributions are replacing X with Wayland. 

You can also read:

First, let's run X's and a few graphical applications in them.

Practicum "run X and applications in it"

I will do everything from the newly created webinaruser user (it would be easier, but not safer, to do everything from root).

  • Since H'am needs access to devices, I give access: I determined the list of devices by looking at errors when starting X's in the log (/home/webinaruser/.local/share/xorg/Xorg.77.log) 

% sudo setfacl -m u:webinaruser:rw /dev/tty8 /dev/dri/card0 /dev/fb0 /dev/input/*

  • After that I start X's:

% X -retro :77 vt8 & 

Options: * -retro - start with a "gray" classic background, not black as the default; * :77 - I set (any one within a reasonable range is possible, only :0 is most likely already occupied by the already running graphics) screen number, some actual unique identifier by which it will be possible to distinguish between several running X's; * vt8 - specifies the terminal, here /dev/tty8, on which X's will be displayed). 

  • Launching the graphical application:

To do this, we first set a variable by which the application will understand which of the Xs I have running to send what needs to be drawn: 

% export DISPLAY=":77" 

You can see the list of running X's like this: 

ps -fwwC X

After the variable has been set, we can launch applications in our X's - for example, I launch the clock:

% xclock -update 1 & 

% xcalc & 

% xeyes -g 200x150-300+50 &

How graphics work in Linux: an overview of the various desktop environments
The main ideas and conclusions from this fragment:

  • X's need access to devices: terminal, video card, input devices,
  • X's themselves do not display any interface elements - it is a gray (if with the "--retro" option) or a black canvas of certain sizes (for example, 1920 × 1080 or 1024 × 768) to run graphical applications in it.
  • The movement of the "cross" shows that X's track the position of the mouse and transmit this information to applications running in it.
  • Also, X's catch keystrokes on the keyboard and pass this information to applications.
  • The DISPLAY variable tells graphics applications on which screen (each X's are launched with a unique screen number at startup), and hence which of those running on my machine, to draw X's. (It is also possible to set this variable to a remote machine and send output to Xs running on another machine on the network.) Since Xs were started without the -auth option, there is no need to deal with the XAUTHORITY variable or the xhost command.
  • Graphical applications (or as they are called by X-clients) are drawn in X's - while without the ability to move / close / change them "-g (Width)x(Height)+(ShiftFromLeftEdge)+(ShiftFromTopEdge)". With a minus sign, respectively, from the right and from the bottom edge.
  • Two terms worth mentioning are X-server (that's what X's are called) and X-clients (that's what any graphical application that runs in X's is called). There is a little confusion in understanding this terminology, many understand it exactly the opposite. In the case when I connect from the “client machine” (in remote access terminology) to the “server” (in remote access terminology) in order to display a graphical application from the server on my monitor, then the X server starts on the machine where the monitor ( that is, on the "client machine", not on the "server"), and X clients start and run on the "server", although they are displayed on the monitor of the "client machine". 

How graphics work in Linux: an overview of the various desktop environments

DE components

Next, we will analyze the components that usually make up the desktop.

DE Components: Start Button and Taskbar

Let's start with the so-called "Start" button. Often this is a separate applet used on the "Taskbar". There is also usually an applet for switching between running applications.

How graphics work in Linux: an overview of the various desktop environments
After looking at different desktop environments, I would summarize such applications under the general name "Apps Manager (Launcher / Switcher)", that is, a tool for managing applications (launching and switching between running ones), and also indicate utilities that are an example of an application of this type .

  • It happens in the form of a "Start" button on the classic (full length of one of the edges of the screen) "Taskbar":

    ○ xfce4-panel,
    ○ mate-panel/gnome-panel,
    ○ vala panel,
    ○ tint2.

  • You can also highlight "MacOS-shaped taskbars" separately (not the entire length of the edge of the screen), although many taskbars can appear in both. Here, rather, the main difference is purely visual - the presence of the "effect of increasing icons on hover."

    ○ dock,
    ○ latte dock,
    ○ cairo dock,
    ○ plank.

  • And / Or a service that launches applications when hotkeys are pressed (in many desktop environments, a similar component is necessarily present and allows you to configure your own hotkeys):

    ○ sxhkd.

  • There are also various menu-shaped "launchers" (from the English. Launch (run)):

    ○ dmenu-run,
    ○ rofi -show drun,
    ○ Albert,
    ○ grunge.

How graphics work in Linux: an overview of the various desktop environments

DE components: WM (Window Manager)

Read more in Russian

Read more in English

WM (Window Manager) - a kind of application that is responsible for managing windows, adds the ability to:

  • moving windows around the desktop (including the standard one with holding down the Alt key for any part of the window, and not just for the title);
  • resizing windows, for example, by dragging the "window frame";
  • adds a “title (title)” and buttons for minimizing / maximizing / closing the application to the window interface;
  • the concept of which application is in "focus".

How graphics work in Linux: an overview of the various desktop environments
I will list the most famous ones (I indicate in parentheses which DE is used by default):

How graphics work in Linux: an overview of the various desktop environments
I will also list "old WM with DE elements". Those. in addition to the window manager, they have elements such as the Start button and the Taskbar, which are more inherent in full-fledged DE. Although how “old” they are, if both IceWM and WindowMaker have already released their updated versions in 2020. It turns out that it is more correct not “old”, but “old-timers”:

How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
How graphics work in Linux: an overview of the various desktop environments
In addition to the "classic" ("stack window managers"), it is worth noting separately tiled WM, which allows windows to be tiled across the entire screen, and for some applications, a separate desktop for each running application in full screen. This is a little unusual for people who have not used them before, but since I myself have been using such an interface for quite a long time, I can say that it is quite convenient and you quickly get used to such an interface, after which the “classic” window managers do not seem convenient.

How graphics work in Linux: an overview of the various desktop environments
It is also worth mentioning separately the project Compiz and such a concept as the “Composite Window Manager”, which uses the capabilities of hardware acceleration to display transparency, shadows, and various three-dimensional effects. About 10 years ago there was a boom in 3D effects on Linux desktops. Now, many of the window managers built into the DE use some of the compositing features. Recently appeared Wayfire - a product with similar Compiz functionality for Wayland.

How graphics work in Linux: an overview of the various desktop environments
A detailed list of various window managers can also be found at  comparison article.

DE components: the rest

It is also worth noting the following desktop components (here I use English established terms to describe the type of application - these are not the names of the applications themselves):

  • Applets:
  • Software (Widget toolkit) - often a certain “minimal set” of software comes with the environment:

DE (Desktop Environment)

Read more in English

From the components listed above, the so-called "Desktop Environment" is obtained. Often all its components are developed using the same graphics libraries and using the same design principles. Thus, at least, the general style for the appearance of applications is maintained.

Here we can highlight the following currently existing desktop environments:

GNOME and KDE are considered the most common, and XFCE is on their heels.

How graphics work in Linux: an overview of the various desktop environments
Comparison by various parameters in the form of a table can be viewed in the corresponding Wikipedia article.  

Variety DE

How graphics work in Linux: an overview of the various desktop environments
Project_Looking_Glass

There are even such interesting examples already from history: in 2003-2007, a “3D desktop design” was made for Linux with the name “Project Looking Glass” from Sun. I myself used this desktop, or rather “played”, as it was hard to use. This "3D skin" was written in Java at a time when there were no 3D graphics cards. Therefore, all the effects were recalculated by the processor, and the computer had to be very powerful, otherwise everything worked slowly. But it turned out beautiful. 360D application tiles could be rotated/expanded. It was possible to rotate in the desktop cylinder with wallpaper from a XNUMX-degree panorama. There were several beautiful applications of their own: for example, listening to music in the form of a “CD changer”, etc. You can look at youtube video about this project, only the quality of these videos will most likely be poor, since in those years it was not possible to upload high quality videos.

How graphics work in Linux: an overview of the various desktop environments
Xfce

Lightweight desktop. There is a project for a long time, since 1996. In recent years, quite popular, as opposed to the heavier KDE and GNOME, on many distributions that require a light and "classic" desktop interface. It has many settings and a large number of its programs: terminal (xfce4-terminal), file manager (thunar), image viewer (ristretto), text editor (mousepad).

 
How graphics work in Linux: an overview of the various desktop environments
Pantheon 

Used in the Elementary OS distribution. Here we can say that there are "desktops" that are developed and used within one separate distribution and are not used much (if not "not used at all") in other distributions. At least they have not yet gained popularity and have not convinced a large part of the audience of the advantages of their approach. Pantheon aims to build a macOS-like interface. 

How graphics work in Linux: an overview of the various desktop environments
Dock panel option:

How graphics work in Linux: an overview of the various desktop environments
Enlightenment

Strong focus on graphical effects and widgets (since the days when other desktop environments didn't have widgets on the desktop, like the calendar/clock). Uses its own libraries. There is a large set of its "beautiful" applications: terminal (Terminology), video player (Rage), picture viewer (Ephoto).

How graphics work in Linux: an overview of the various desktop environments
moksha

This is a fork of Enlightenment17 that is used in the BodhiLinux distribution. 

How graphics work in Linux: an overview of the various desktop environments
GNOME

Initially a "classic" desktop interface, created in opposition to KDE, which was written on the QT library, at that time distributed under a license that was not very convenient for commercial distributions. 

How graphics work in Linux: an overview of the various desktop environments
GNOME_Shell

From the third version of GNOME, GNOME began to ship with the GNOME Shell, which has a "non-classic look", which not all users liked (any sudden changes in interfaces are difficult for users to accept). As a result - the emergence of fork projects that continue the development of this desktop in the "classic" style: MATE and Cinnamon. Used by default in many commercial distributions. It has a large number of settings and its applications. 

How graphics work in Linux: an overview of the various desktop environments
MATE 

Appeared on the basis of GNOME2 and continues to develop this environment. It has a large number of tweaks and forks of applications that were used back in GNOME2 (new names are used in order not to confuse the forks with their new version for GNOME3).

How graphics work in Linux: an overview of the various desktop environments
Cinnamon

A fork of GNOME Shell that provides users with a "classic" style interface (as it was in GNOME2). 

It has a large number of settings and the same applications as for GNOME Shell.

How graphics work in Linux: an overview of the various desktop environments
Budgie

A "classic" style fork of GNOME that developed as part of the Solus distribution, but now also comes as a standalone desktop on various other distributions.

How graphics work in Linux: an overview of the various desktop environments
KDE_Plasma (or, as it is often called, just KDE) 

Desktop environment developed by the KDE project. 

It has a huge number of settings available to a simple user from the graphical interface and many graphical applications developed within this desktop.

How graphics work in Linux: an overview of the various desktop environments
Trinity

In 2008, KDE released their new implementation of KDE Plasma (the desktop engine was heavily rewritten). Also, as with GNOME/MATE, not all KDE fans liked it. As a result, a fork of the project appeared, continuing the development of the previous version, called TDE (Trinity Desktop Environment).

How graphics work in Linux: an overview of the various desktop environments
Deepin_DE

One of the newer desktop environments written using Qt (which is what KDE is written on). It has many settings and a rather beautiful (although this is a subjective concept) and well-developed interface. Developed as part of the Deepin Linux distribution. There are also packages for other distributions.

How graphics work in Linux: an overview of the various desktop environments
Flight 

An example of a desktop environment written using Qt. Developed as part of the Astra Linux distribution. 

How graphics work in Linux: an overview of the various desktop environments
LXQt

Lightweight desktop environment. Like several previous examples, written using Qt. In fact, it is a continuation of the LXDE project and the result of a merger with the Razor-qt project.

As you can see, the Linux desktop can look very different and there is a suitable interface for everyone's taste: from very beautiful and with 3D effects to minimalistic, from "classic" to unusual, from system-heavy to lightweight, from large screens to tablets/smartphones.

Well, I would like to hope that I managed to give an idea of ​​​​what are the main components of the graphics and desktop in Linux OS.

The material for this article was tested in July 2020 at a webinar. It can be viewed here.

That's all. I hope it was helpful. If you have any questions and comments, write. I will be glad to answer. Well, come and study Network Academy LANIT!

Source: habr.com

Add a comment