How Graphics Work in Linux: An Overview of Different Desktop Environments

This article is about how graphics work in Linux and what components they consist of. It contains many screenshots of various implementations of desktop environments. 



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



The topic may also interest advanced users when setting up remote access and when implementing a thin client. I often meet quite experienced Linux users with the statements "there is only the command line on the server, and I do not 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 of the ssh command (which is useful to understand how the X server works and functions).



A source



I have been teaching Linux courses at LANIT Networking Academy for almost 15 years”And I am sure that many of those more than five thousand people whom I trained read and probably write articles on Habr. Courses are always very rich (the average duration of a course is five days), you need to talk about topics that take at least ten days to fully familiarize yourself with. And always during the course, depending on the audience (newcomers gathered or seasoned administrators), as well as on "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 of those that have to sacrifice 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 Linux, understanding the available diversity (so that even using one specific Linux distribution, you still have a broader view of this whole a huge and immense world that is called "Linux") it is useful and necessary to study these topics. 



In the course of the article, for each component, I provide links for those who want to dive deeper into the topic, for example, to articles on Wikipedia (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. Any other community developed distribution could be used 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 only use 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 the DM / DE / WM (explanation of these terms below) that I found in the repository. 



The screenshots with "blue frames" are taken on openSUSE. 



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



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



So, let's begin.



The main components that make up the graphics



I will highlight three main components and list them in the order they start at system startup: 



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


Additionally, as important sub-items in 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 the "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 launch.


At the moment, various distributions are widely used: 





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











It is worth noting that the following screenshots use the same LightDM display manager, but in different distributions (distributions are named in parentheses). Check out how different this DM can look thanks to the work of the designers of various distributions.













The main thing in this variety is to make it clear that there is an application that is responsible for launching graphics and allowing the user to access this graphics, and there are different implementations of this application that differ in appearance and a little functionality (choice of design environments, choice of users, version for bad seeing users, the availability of remote access via the XDMCP protocol ).



Display Server



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



When we talk about Display Server, for many years in Linux, and in Unix, the X Window System application or, in the common people, X (X) was meant



Many distributions are now replacing X with Wayland . You can also read: 









To get started, let's launch X's and several graphics applications in them.



Workshop "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 as root).



  • Since X'am needs access to devices, I give access: The list of devices was determined by looking at errors when starting X'ov 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 - run with a "gray" classic background, not black as the default; *: 77 - I set (any in a reasonable range is possible, only: 0 is most likely already occupied for an already running schedule) the screen number, an actual unique identifier by which it will be possible to distinguish between several running X's; * vt8 - indicates the terminal, here / dev / tty8, on which the X's will be displayed). 



  • We launch the graphical application:


To do this, we first set a variable by which the application will understand which of the X's running on me to send what needs to be drawn: 



% export DISPLAY=":77" 



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



ps -fwwC X



After setting the  variable, you can launch applications in our X 's - for example, I start the clock:



% xclock -update 1 & 



% xcalc & 



% xeyes -g 200x150-300+50 &






Key ideas and takeaways from this snippet:



  • X' : , , ,
  • X' β€” ( Β«--retroΒ») (, 1920x1080 1024x768), .
  • «» , X' .
  • X' .
  • DISPLAY , ( X' ), ,  X'. ( X', .) X' -auth, XAUTHORITY xhost.
  • ( X-) X' β€” // Β«-g ()x()+()+()Β». «»  .
  • Two terms that are worth voicing: X-server (as the X's are called) and X-clients (as any graphical application launched in X's is called). There is a little confusion in the understanding of this terminology, many understand it exactly the opposite. In the case when I from the "client machine" (in the terminology of remote access) connect to the "server" (in the terminology of remote access) to display a graphical application from the server on my monitor, then the X-server is launched 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". 




DE components



Next, let's take a look at the components that typically make up a desktop.



DE Components: Start Button and Taskbar



Let's start with the so-called "Start" button. This is often a separate applet used in the taskbar. It also usually has an applet for switching between running applications.





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 launched 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.
  • Β«MacOS- Β» ( ), . β€” Β« Β».



    β—‹ docky,

    β—‹ latte-dock,

    β—‹ cairo-dock,

    β—‹ plank.
  • / , Β« Β» ( ):



    β—‹ sxhkd.
  • - «» ( . Launch ()):



    β—‹ dmenu-run,

    β—‹ rofi -show drun,

    β—‹ albert,

    β—‹ grun.




DE: WM (Window Manager)



More in Russian



More in English



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



  • moving windows across the desktop (including the standard one by holding down the Alt key for any part of the window, not just the title);
  • resizing windows, for example, by dragging outside the "window frame";
  • adds a "title" and buttons to minimize / maximize / close the application to the window interface;
  • the concept of which application is in focus.




I will list the most famous ones (in parentheses I indicate in which DE is used by default):







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 a full-fledged DE. How old are they, though, 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":















In addition to the "classic" ("stack window managers"), it is worth mentioning tiled WMs , which allow you to tiled windows across the entire screen, as well as for some applications a separate desktop for each application launched on the full screen. This is a bit unusual for people who have not used them before, but since I myself have been using such an interface for a long time, I can say that it is quite convenient and you quickly get used to this interface, after which the "classic" window managers do not seem convenient.







It is also worth mentioning separately the Compiz project and such a concept as "Composite Window Manager", which uses 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. Many of the window managers built into DE are now taking advantage of composite capabilities in part. Wayfire recently appeared - a product with similar Compiz functionality for Wayland.





A detailed list of different window managers can also be found in  the comparison article .



DE components: rest



It is also worth noting the following components of the desktop (here I use well-established English 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 is supplied with the environment:


DE (Desktop Environment)



More in English



From the components listed above, the so-called "Desktop design environment" is obtained. Often all its components are developed using the same graphics libraries and using the same design principles. This, at a minimum, maintains a general style for the appearance of applications.



Here we can highlight the following currently existing desktop environments:





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





Comparison by various parameters in the form of a table can be found in the corresponding Wikipedia article .  



Variety DE





Project_Looking_Glass



There are even such interesting examples from history: in 2003-2007 a "3D desktop design" was made for Linux called "Project Looking Glass" from Sun. I myself used this desktop, or rather β€œplayed”, as it was difficult to use. This "3D design" was written in Java at a time when there were no 3D graphics cards. Therefore, all the effects were counted by the processor, and the computer had to be very powerful, otherwise everything worked slowly. But it turned out beautifully. Three-dimensional application dies could be rotated / expanded. It was possible to turn in a cylinder of a desktop with wallpaper from a 360 degree panorama. There were several beautiful applications of their own: for example, listening to music in the form of "changing CDs", etc. You can watch on youtubevideo 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.





Xfce



Lightweight desktop. The project has existed for a long time, since 1996. In recent years, it has been quite popular, in contrast to the heavier KDE and GNOME, which on many distributions 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).



 



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 heavily used (if not "not used at all") in other distributions. At least they haven't yet gained popularity and convinced a large part of the audience of the benefits of their approach. Pantheon aims to build a macOS-like interface. 





Dock option:





Enlightenment



Strong emphasis on graphics effects and widgets (since the days when other desktop environments did not have widgets on the desktop, such as calendar / clock). Uses its own libraries. There is a large set of its "beautiful" applications: terminal (Terminology), video player (Rage), viewing pictures (Ephoto).





Moksha



This is a fork of Enlightenment17 and is used by the BodhiLinux distribution. 





GNOME



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





GNOME_Shell



Since the third version, GNOME began to ship with the GNOME Shell, which has a "non-classic look", which not all users liked (any drastic changes in interfaces are difficult for users to accept). As a consequence - 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. Has a large number of settings and applications. 





MATE is 



based on GNOME2 and continues to evolve this design environment. Has a large number of settings and forks of applications that were used in GNOME2 (new names are used) in order not to confuse forks with their new version for GNOME3).





Cinnamon A



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



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





Budgie A



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





KDE_Plasma (or, as it is often called, simply KDE) 



A 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.





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 like it. As a result, a fork of the project appeared, continuing the development of the previous version, called TDE (Trinity Desktop Environment).





Deepin_DE



One of the newer desktop environments written using Qt (which is where KDE is written). It has many settings and is quite 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





Fly 



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





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 desktop in Linux can look very different and there will be a suitable interface for everyone's taste: from very beautiful and with 3D-effects to minimalistic, from "classic" to unusual, from actively using system resources to lightweight, from large screens to tablets / smartphones.



Well, I hope that I was able to give an idea of ​​what are the main components of the graphics and desktop in Linux.



The material for this article was rolled out in July 2020 at a webinar. You can watch it here .



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



All Articles