Display manager (dm) and the window manager (wm) take 2016 'Best Couple' honors
Best Couple of 2016: Display manager and window manager
In the 2015 Open Source Yearbook, ssh and tar received the "Best Couple" honor.
My selection for Best Couple of 2015—yes, that was last year—was ssh and tar, a pair of Linux commands that work together nicely to accomplish great things. This year I have made a different type of selection for Best Couple of 2016. My choices for Best Couple this year are actually a pair of program types—not specific commands or programs.
So let's welcome our Best Couple of 2016: Put your hands together for the display manager (dm) and the window manager (wm).
These two programs, regardless of which ones you use on your Linux GUI desktop system, always work closely together to make your GUI experience smooth and seamless before you even get to your desktop.
The display manager is a bit of code that provides the GUI login screen for your Linux desktop. After you log in to a GUI desktop, the display manager turns control over to the window manager. When you log out of the desktop, the display manager is given control again to display the login screen and wait for another login.
There are several display managers—some are provided with their respective desktops. Note that some display managers are not directly associated with a specific desktop. Any of the display managers can be used for your login screen regardless of which desktop you are using. And not all desktops have their own display managers. Such is the flexibility of Linux and well-written, modular code.
The typical desktops and display managers are shown in the table below:
|GNOME||GDM||GNOME Display Manager|
|KDE||KDM||KDE Display Manager (up through Fedora 20)|
|LightDM||Lightweight Display Manager|
|LXDE||LXDM||LXDE Display Manager|
|KDE||SDDM||Simple Desktop Display Manager (Fedora 21 and above)|
|XDM||Default X Window System Display Manager|
Table 1: A short list of display managers.
The display manager for the first desktop (i.e., GNOME, KDE, etc.) installed is the default one. For Fedora, this is usually GDM, which is the display manager for GNOME. If GNOME is not installed, then the display manager for the installed desktop is the default. If the desktop selected during installation does not have a default display manager, then GDM is installed and used. If you use KDE as your desktop, the new SDDM (Simple Desktop Display Manager) will be the display manager.
Regardless of which display manager is configured as the default at installation time, later installation of additional desktops does not automatically change the display manager used. If you want to change the display manager, you must do it yourself from the command line. Any display manager can be used, regardless of which window manager and desktop is used.
The function of a window manager is to manage the creation, movement, and destruction of windows on a GUI desktop. The window manager works with the X Window System or the newer Wayland to perform these tasks. The X Window System provides all of the graphical primitives and functions to generate the graphics for a Linux or Unix graphical user interface.
The window manager also controls the appearance of the windows it generates. This includes the functional decorative aspects of the windows, such as the look of buttons, sliders, window frames, pop-up menus, and more.
As with almost every other component of Linux, there are many different window managers from which to choose. The following list represents only a sample of the available window managers.
|KDE||Kwin||Starting with KDE Plasma 4 in 2008|
|GNOME||Metacity||Default for GNOME 2|
|GNOME||Mutter||Default starting with GNOME 3|
|twm||A very old and simple window manager. Some distros like Fedora use it as a fallback in case no other window manager or desktop is available.|
Table 2: A short list of window managers.
Note that most window managers are not directly associated with any specific desktop. In fact, some window managers can be used without any type of desktop software, such as KDE or GNOME, to provide a minimalist GUI experience for users.
How do I deal with all these choices?
In most modern distributions, the choices are made for you at installation time and are based on your selection of desktops and the preferences of the packagers of your distribution. The desktop itself can be easily changed in some distributions and the display manager can also be changed in many cases.
Prior to Fedora 18, changing the display manager was done by changing the line
PREFERRED= in the /etc/sysconfig/desktop file. That file was sourced by the /etc/X11/prefdm file. If the file did not exist, you could create it, adding the
PREFERRED= line (in caps) with the name and path of the preferred desktop manager. You could also set it directly in the prefdm file, but that change could be wiped out by an upgrade or reinstallation.
Now that systemd has become the standard startup system in many distributions, you can set the preferred display manager in /etc/systemd/system, which is where the basic system startup configuration is located. There is a symbolic link (symlink) named display-manager.service that points to one of the display manager service units in /usr/lib/systemd/system. Each installed display manager has a service unit in the /usr/lib/systemd/system directory.
To change the active display manager, remove the existing display-manager.service link and replace it with the one you want to use. For example, to configure to use the KDM display manager, use the following commands:
cd /etc/systemd/system rm display-manager.service ln -s /usr/lib/systemd/system/kdm.service display-manager.service
The only information I could find initially about changing the window manager is in the Fedora 13 Deployment Guide, which is obviously fairly old and may no longer be valid. I also found information on the
wmctrl command, which, as its name implies, provides some control over the window manager but no capability to change the window manager.
I did find that some distros and desktops have various means of changing the window manager. For example, GNOME users can use gconf-editor and Puppy Linux uses the
As with many other components of GNU/Linux, many different display and window managers are available. When you install most modern distributions with any kind of desktop, the installation program chooses which ones to install and activate. For most users, there should never be any need to change these choices. For others who have different needs or who are simply more adventurous, there are many options and combinations from which to choose. With a little research, you can make interesting changes.