• We will talk about how the graphical environment, or layers and interfaces, work on a typical Linux desktop. There are three basic layers and each one has a choice of options for what you can use.


  • These are the X Window System, the Window Manager, and the Desktop Manager. The lines between these layers, especially the Window Manager and Desktop Manager can actually be blurred, but in principle, there are three layers.


  • Now, the X Window system, usually just called X these days, has a long history, it goes back to at least 1984. In its early incarnations, it was designed to handle displaying the results on remote computers at your local workstation or X client, the X terminal, as it was called.


  • So, all-in-all, it was a communication protocol. It wasn't originally designed to just be run on an individual computer. X function is relatively simple, it handles the keyboard and the pointer and it displays the result on the screen.


  • Now, in X nomenclature, the server is what runs on your local machine, the client is the application. It could be on your machine, it could be anywhere on your network.


  • Usually, when people talk about servers and clients, they should think of server being some place remote, so this is a different usage of those two words. Now, because X grew out of a network paradigm, sometimes it's criticized as having high overhead because it's using the whole network stack, even if it's on a local workstation or a laptop.


  • But that's no longer the truth, X uses Unix domain sockets, shared memory, and other features. Such that that criticism really doesn't hold any weight in modern systems.


  • These days, most Linux systems will configure X automatically. You really don't have to do it yourself. But there are standard configuration files. Location varies a little bit, but the file is called xorg.conf.


  • That if you have a specialized situation, you can go on and configure.


  • Along with the X server itself, there are many basic programs that ship with X in order for it to function. X is rather old, it wouldn't have been designed the way it was designed today.


  • So there are new alternatives, in particular, gaining popularity is Wayland.


  • It has been the default in Fedora for quite some time now, in the Fedora distribution, Wayland is far more secure than X. It's still missing one or two things that people are used to with X.


  • But basically, it works just fine, and most people using it can't even tell they're not using X anymore.


  • So gradually, it will supplant X as distributions gradually move over to it. Now, the next step up from X is the window manager. The window manager controls things like the appearance of a window, what the title bar, scroll bars look like. It handles multiple desktops, which is a very common feature used in Linux systems, and other visual effects.


  • There are a number of different window managers for Linux. They tend to be associated with the desktop manager


  • For recent GNOME versions, we use something called mutter, and KDE uses something called kwin. And there are other ones that are in use. Some are very flashy, some are rather minimal and work very quickly.


  • The desktop manager is what the user actually sees and it controls what's on the desktop. And it sits above X and the window manager. This provides taskbars, menu bars, drop-down menus, controls drag and drop between applications.


  • It controls menus, icons, program launchers, all the stuff that any experienced computer user is used to on any graphical desktop environment.


  • So, the most common ones as we said are GNOME and KDE. Another one that's used quite ofte


  • You can generally choose which desktop you want when you're doing the installation. And if you feel like installing the software for both, you can usually choose between, let's say GNOME or KDE when you boot the system.


  • So that you can actually play with both. And note that the KDE and GNOME developers actually do talk to each other. And they make it possible, so that if you have a KDE graphical program, you can run it while running GNOME and vice versa.


  • Usually, this works just fine. Now, very often you want to work at the command line, but you want to do that while running a graphical environment, so there are a number of different ways to do that. On GNOME, people generally run the gnome-terminal program, which we will discuss extensively in a little while.


  • But that launches a command line terminal in which you can type in commands, see the output, etc.


  • How you launch it depends a little bit on distribution and version that you're running. It may be just an icon you can click on. You can usually hit Alt+F2 and then type in the name of the terminal manager, so gnome-terminal. And then just run it, etc.


  • And on most distributions, you can right click on the background, and it'll give you an option to open the terminal.


  • Now there are a lot of things you could do with terminals. You can have multiple tabs open at once. You can have multiple terminals over at once, etc. This is as true with the KDE konsole program as it is with gnome-terminal under GNOME.


  • Open up a terminal window. For GNOME, you can do this by one of three methods:


  • Find the terminal application in the Application menu system, either under Accessories or System Tools.


  • Hit Alt-F2 to bring up the Run Command window and type in gnome-terminal. If right-clicking anywhere on the desktop does not offer an option for bringing up a new terminal, you may have to install nautilus-open-terminal by doing one of the following commands depending on your Linux distribution and then right click anywhere on the desktop and select Open Terminal:


  • Right-clicking anywhere in the terminal window will open either a new terminal or a new tab. On older versions, you can select either. On newer GNOME versions, you have to select which one you want to be offered by clicking on Edit > Preferences and then choose either Window or Tab under the dialog for Open new terminals in. Why this is considered an improvement is not clear.


  •  
    $ sudo yum install nautilus-open-terminal
    $ sudo apt-get install Nautilus-open-terminal
    $ sudo zypper install Nautilus-open-terminal
     
    
  • Or you can hit Shift > Ctl-T.


  • If you open multiple tabs, you can switch between them either with the mouse or by hitting Alt-1, Alt-2, etc.


  • While you are at it, it would be a good time to learn how to configure the profile or create a new one, changing fonts, colors, etc.


  • For KDE, the konsole program can be used in much the same way, with new windows being launched with Ctl-Shift-M and new tabs with Ctl-Shift-N.