Dernière mise-à-jour :

106.2 - Configurer un display manager (1/60)

Gestionnaire de Fenêtres

X ne doit être confondue avec un Gestionnaire de Fenêtres (Window Manager). Le Gestionnaire de Fenêtres est responsable de la mise en page des élements fournis pas X. C'est pour cette raison que sous Linux il existe de nombreux Gestionnaires différents tels :

KDE,

GNOME,

twm,

IceWM,

Rvwm,

CDE,

WindowMaker,

Enlightenment,

Xfce,

Afterstep

Compiz Fusion,

Fluxbox,

Openbox,

Metacity,

Blackbox,

Ion,

Wmii,

etc.

Les Gestionnaires les plus connus sont :

KDE (Kool Desktop Environment) par Matthias Ettrich en 1996,

GNOME (Gnu Network Object Model Environment) par Miguel de Icaza et Federico Mena en 1997,

Toolkits

Chaque Gestionnaire utilise une bibliothèque graphique contenant des fonctions “toutes faites” pour créer les éléments graphiques. Chaque elément pour le Gestionnaire lui même s'appelle un Widget (Windows Gadget) tandis que élément pour une fenêtre s'appelle simplement un Gadget.

Une bibliothèque complète est appelée un Widget Toolkit. Le Toolkit le plus connu est MOTIF. Cependant MOTIF n'est pas libre. Pour cette raison les développeurs de Linux ont du concevoir des Toolkits ayant une licence libre.

Comme dans beaucoup de cas de développement sous Linux, il existe plusieurs Toolkits dont les deux les plus connus sont :

GTK (GIMP Toolkit), programé en langage C et embarqué par défaut dans le Gestionnaire de Fenêtres Gnome,

QT (Cute), programé en langage C++ et embarqué par défaut dans le Gestionnaire de Fenêtres KDE.

Freedesktop

Afin d'assurer la possibilité d'utiliser une application développée avec GTK sur un système fonctionnant sous QT et vice-versa, les développeurs de GNOME et KDE ont créé ensemble le projet Freedesktop. Les développements issus de ce projet sont intégrés dans les deux Gestionnaires.

Display Manager

Le Display Manager est chargé de gérer les connexions locales et à distance, les authentifications et les ouvertures de sessions. De ce fait, Le Display Manager est l'équivalent des services console init, getty et login réunis.

Pour les connexions à distance le Display Manager utilise le protocole XDMCP (X Display Manager Control Panel)). Le fichier de configuration de XDMCP est /etc/X11/xdm/xdmconfig.

XDM, GDM et KDM

Le Display Manager par défaut, compatible avec tous les serveurs X, est XDM. Les deux autres Display Managers les plus connus sont :

GDM pour GNOME,

KDM pour KDE,

LightDM de Canonical.

Les deux premiers sont essentiellement des XDM avec des fonctionnalités supplémentaires telles :

le passage d'un utilisateur à un autre,

la liste des utilisateurs,

le choix d'un gestionnaire de fenêtres,

la possibilité d'une autoconnexion,

la liste des serveurs X distants,

etc.

LightDM

LightDM est un gestionnaire d'affichage conçu pour être une alternative relativement légère et très personnalisable à GDM par Robert Ancell, de Canonical. LightDM possède les caractéristiques suivantes :

Pas de dépendances de Gnome

Utilisation de webkit pour le rendu des thèmes

Support de Toolkits Gtk et Qt

Sous RHEL/CentOS 7, LightDM n'est pas installé par défaut et se trouve dans le dépôt EPEL. Installez donc le dépôt :

[root@centos7 ~]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: fr.mirror.babylon.network
* extras: fr.mirror.babylon.network
* updates: fr.mirror.babylon.network
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
epel-release noarch 7-6 extras 14 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-6.noarch.rpm | 14 kB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-6.noarch 1/1
Verifying : epel-release-7-6.noarch 1/1
Installed:
epel-release.noarch 0:7-6
Complete!

Installez ensuite LightDM :

[root@centos7 ~]# yum install -y lightdm
Loaded plugins: fastestmirror, langpacks
epel/x86_64/metalink | 23 kB 00:00
epel | 4.3 kB 00:00
(1/3): epel/x86_64/group_gz | 170 kB 00:00
(2/3): epel/x86_64/updateinfo | 588 kB 00:00
(3/3): epel/x86_64/primary_db | 4.3 MB 00:01
Loading mirror speeds from cached hostfile
* base: fr.mirror.babylon.network
* epel: mirrors.ircam.fr
* extras: fr.mirror.babylon.network
* updates: fr.mirror.babylon.network
Resolving Dependencies
--> Running transaction check
---> Package lightdm.x86_64 0:1.10.6-4.el7 will be installed
--> Processing Dependency: lightdm-greeter = 1.2 for package: lightdm-1.10.6-4.el7.x86_64
--> Processing Dependency: lightdm-gobject(x86-64) = 1.10.6-4.el7 for package: lightdm-1.10.6-4.el7.x86_64
--> Running transaction check
---> Package lightdm-gobject.x86_64 0:1.10.6-4.el7 will be installed
---> Package lightdm-gtk.x86_64 0:1.8.5-19.el7 will be installed
--> Processing Dependency: lightdm-gtk-common = 1.8.5-19.el7 for package: lightdm-gtk-1.8.5-19.el7.x86_64
--> Running transaction check
---> Package lightdm-gtk-common.noarch 0:1.8.5-19.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
lightdm x86_64 1.10.6-4.el7 epel 190 k
Installing for dependencies:
lightdm-gobject x86_64 1.10.6-4.el7 epel 57 k
lightdm-gtk x86_64 1.8.5-19.el7 epel 58 k
lightdm-gtk-common noarch 1.8.5-19.el7 epel 57 k
Transaction Summary
================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 362 k
Installed size: 970 k
Downloading packages:
warning: /var/cache/yum/x86_64/7/epel/packages/lightdm-1.10.6-4.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for lightdm-1.10.6-4.el7.x86_64.rpm is not installed
(1/4): lightdm-1.10.6-4.el7.x86_64.rpm | 190 kB 00:01
(2/4): lightdm-gobject-1.10.6-4.el7.x86_64.rpm | 57 kB 00:00
(3/4): lightdm-gtk-1.8.5-19.el7.x86_64.rpm | 58 kB 00:00
(4/4): lightdm-gtk-common-1.8.5-19.el7.noarch.rpm | 57 kB 00:00
--------------------------------------------------------------------------------
Total 179 kB/s | 362 kB 00:02
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-6.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : lightdm-gobject-1.10.6-4.el7.x86_64 1/4
Installing : lightdm-gtk-common-1.8.5-19.el7.noarch 2/4
Installing : lightdm-1.10.6-4.el7.x86_64 3/4
Installing : lightdm-gtk-1.8.5-19.el7.x86_64 4/4
Verifying : lightdm-gtk-common-1.8.5-19.el7.noarch 1/4
Verifying : lightdm-gtk-1.8.5-19.el7.x86_64 2/4
Verifying : lightdm-1.10.6-4.el7.x86_64 3/4
Verifying : lightdm-gobject-1.10.6-4.el7.x86_64 4/4
Installed:
lightdm.x86_64 0:1.10.6-4.el7
Dependency Installed:
lightdm-gobject.x86_64 0:1.10.6-4.el7 lightdm-gtk.x86_64 0:1.8.5-19.el7 lightdm-gtk-common.noarch 0:1.8.5-19.el7
Complete!

Le fichier de configuration de LightDM est /etc/lightdm/lightdm.conf :

[root@centos7 ~]# cat /etc/lightdm/lightdm.conf
#
# General configuration
#
# start-default-seat = True to always start one seat if none are defined in the configuration
# greeter-user = User to run greeter as
# minimum-display-number = Minimum display number to use for X servers
# minimum-vt = First VT to run displays on
# lock-memory = True to prevent memory from being paged to disk
# user-authority-in-system-dir = True if session authority should be in the system location
# guest-account-script = Script to be run to setup guest account
# logind-load-seats = True to automatically set up multi-seat configuration from logind
# logind-check-graphical = True to on start seats that are marked as graphical by logind
# log-directory = Directory to log information to
# run-directory = Directory to put running state in
# cache-directory = Directory to cache to
# sessions-directory = Directory to find sessions
# remote-sessions-directory = Directory to find remote sessions
# greeters-directory = Directory to find greeters
# backup-logs = True to move add a .old suffix to old log files when opening new ones
#
[LightDM]
#start-default-seat=true
#greeter-user=lightdm
#minimum-display-number=0
minimum-vt=1
#lock-memory=true
user-authority-in-system-dir=true
#guest-account-script=guest-account
#logind-load-seats=false
#logind-check-graphical=false
#log-directory=/var/log/lightdm
#run-directory=/var/run/lightdm
#cache-directory=/var/cache/lightdm
#sessions-directory=/usr/share/lightdm/sessions:/usr/share/xsessions
#remote-sessions-directory=/usr/share/lightdm/remote-sessions
#greeters-directory=/usr/share/lightdm/greeters:/usr/share/xgreeters
#backup-logs=true
#
# Seat defaults
#
# type = Seat type (xlocal, xremote)
# xdg-seat = Seat name to set pam_systemd XDG_SEAT variable and name to pass to X server
# pam-service = PAM service to use for login
# pam-autologin-service = PAM service to use for autologin
# pam-greeter-service = PAM service to use for greeters
# xserver-command = X server command to run (can also contain arguments e.g. X -special-option)
# xmir-command = Xmir server command to run (can also contain arguments e.g. Xmir -special-option)
# xserver-layout = Layout to pass to X server
# xserver-config = Config file to pass to X server
# xserver-allow-tcp = True if TCP/IP connections are allowed to this X server
# xserver-share = True if the X server is shared for both greeter and session
# xserver-hostname = Hostname of X server (only for type=xremote)
# xserver-display-number = Display number of X server (only for type=xremote)
# xdmcp-manager = XDMCP manager to connect to (implies xserver-allow-tcp=true)
# xdmcp-port = XDMCP UDP/IP port to communicate on
# xdmcp-key = Authentication key to use for XDM-AUTHENTICATION-1 (stored in keys.conf)
# unity-compositor-command = Unity compositor command to run (can also contain arguments e.g. unity-system-compositor -special-option)
# unity-compositor-timeout = Number of seconds to wait for compositor to start
# greeter-session = Session to load for greeter
# greeter-hide-users = True to hide the user list
# greeter-allow-guest = True if the greeter should show a guest login option
# greeter-show-manual-login = True if the greeter should offer a manual login option
# greeter-show-remote-login = True if the greeter should offer a remote login option
# user-session = Session to load for users
# allow-user-switching = True if allowed to switch users
# allow-guest = True if guest login is allowed
# guest-session = Session to load for guests (overrides user-session)
# session-wrapper = Wrapper script to run session with
# greeter-wrapper = Wrapper script to run greeter with
# guest-wrapper = Wrapper script to run guest sessions with
# display-setup-script = Script to run when starting a greeter session (runs as root)
# display-stopped-script = Script to run after stopping the display server (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
# autologin-guest = True to log in as guest by default
# autologin-user = User to log in with by default (overrides autologin-guest)
# autologin-user-timeout = Number of seconds to wait before loading default user
# autologin-session = Session to load for automatic login (overrides user-session)
# autologin-in-background = True if autologin session should not be immediately activated
# exit-on-failure = True if the daemon should exit if this seat fails
#
[SeatDefaults]
#type=xlocal
#xdg-seat=seat0
#pam-service=lightdm
#pam-autologin-service=lightdm-autologin
#pam-greeter-service=lightdm-greeter
xserver-command=X -background none
#xmir-command=Xmir
#xserver-layout=
#xserver-config=
#xserver-allow-tcp=false
#xserver-share=true
#xserver-hostname=
#xserver-display-number=
#xdmcp-manager=
#xdmcp-port=177
#xdmcp-key=
#unity-compositor-command=unity-system-compositor
#unity-compositor-timeout=60
greeter-session=lightdm-greeter
#greeter-hide-users=false
#greeter-allow-guest=true
#greeter-show-manual-login=false
#greeter-show-remote-login=true
#user-session=default
#allow-user-switching=true
#allow-guest=true
#guest-session=
session-wrapper=/etc/X11/xinit/Xsession
#greeter-wrapper=
#guest-wrapper=
#display-setup-script=
#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
#autologin-guest=false
#autologin-user=
#autologin-user-timeout=0
#autologin-in-background=false
#autologin-session=UNIMPLEMENTED
#exit-on-failure=false
#
# Seat configuration
#
# Each seat must start with "Seat:".
# Uses settings from [SeatDefaults], any of these can be overriden by setting them in this section.
#
#[Seat:0]
#
# XDMCP Server configuration
#
# enabled = True if XDMCP connections should be allowed
# port = UDP/IP port to listen for connections on
# listen-address = Host/address to listen for XDMCP connections (use all addresses if not present)
# key = Authentication key to use for XDM-AUTHENTICATION-1 or blank to not use authentication (stored in keys.conf)
#
# The authentication key is a 56 bit DES key specified in hex as 0xnnnnnnnnnnnnnn. Alternatively
# it can be a word and the first 7 characters are used as the key.
#
[XDMCPServer]
#enabled=false
#port=177
#listen-address=
#key=
#
# VNC Server configuration
#
# enabled = True if VNC connections should be allowed
# command = Command to run Xvnc server with
# port = TCP/IP port to listen for connections on
# listen-address = Host/address to listen for VNC connections (use all addresses if not present)
# width = Width of display to use
# height = Height of display to use
# depth = Color depth of display to use
#
[VNCServer]
#enabled=false
#command=Xvnc
#port=5900
#listen-address=
#width=1024
#height=768
#depth=8

La configuration de l'écran d'accueil GTK de LightDM se trouve dans le fichier /etc/lightdm/lightdm-gtk-greeter.conf :

[root@centos7 ~]# cat /etc/lightdm/lightdm-gtk-greeter.conf
#
# background = Background file to use, either an image path or a color (e.g. #772953)
# theme-name = GTK+ theme to use
# icon-theme-name = Icon theme to use
# font-name = Font to use
# xft-antialias = Whether to antialias Xft fonts (true or false)
# xft-dpi = Resolution for Xft in dots per inch (e.g. 96)
# xft-hintstyle = What degree of hinting to use (none, slight, medium, or hintfull)
# xft-rgba = Type of subpixel antialiasing (none, rgb, bgr, vrgb or vbgr)
# show-indicators = semi-colon ";" separated list of allowed indicator modules. Built-in indicators include "~a11y", "~language", "~session", "~power". Unity indicators can be represented by short name (e.g. "sound", "power"), service file name, or absolute path
# show-clock (true or false)
# clock-format = strftime-format string, e.g. %H:%M
# keyboard = command to launch on-screen keyboard
# position = main window position: x y
# default-user-image = Image used as default user icon, path or #icon-name
# screensaver-timeout = Timeout (in seconds) until the screen blanks when the greeter is called as lockscreen
#
[greeter]
background=/usr/share/backgrounds/day.jpg
#theme-name=
#icon-theme-name=
#font-name=
#xft-antialias=
#xft-dpi=
#xft-hintstyle=
#xft-rgba=
#show-indicators=
#show-clock=
#clock-format=
#keyboard=
#position=
#screensaver-timeout=

<html>

Copyright © 2004-2017 Hugh Norris.<br><br> <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/fr/”><img alt=“Licence Creative Commons” style=“border-width:0” src=“http://i.creativecommons.org/l/by-nc-nd/3.0/fr/88x31.png” /></a><br />Ce(tte) oeuvre est mise à disposition selon les termes de la <a rel=“license” href=“http://creativecommons.org/licenses/by-nc-nd/3.0/fr/”>Licence Creative Commons Attribution - Pas d’Utilisation Commerciale - Pas de Modification 3.0 France</a>.

</html>