It requires improvements. If you want to improve it, simply log in and click on the Edit tab.
This page describes the uses of the /etc/X11/wmsession.d directory, for storing info about desktop managers, and how to add new window managers and display managers.
Contents
How it works
This directory is used to store information about the different window managers ( or wm in short) that can be accessed by the different display managers ( also called a dm, or a login manager ).
Each dm uses different configuration files, so to update their configuration, you should drop a file in the /etc/X11/wmsession.d
directory. Nowadays there is no more need to use %make_session in %post and %postun to update dm config, this is automagically handled by RPM filetriggers
%make_session would only run the program /usr/sbin/fndSession
. It updates the configuration of kdm
and of gdm
.
The current script use chksession
to read the different session files and to modify the config file of the different dm. The files ending with .rpmsave
, .rpmold
and ~
are not taken into account.
Format of a session file
A typical session file looks like this :
NAME=KDE ICON=kde-wmsession.xpm DESC=The K Desktop Environment EXEC=/usr/bin/startkde SCRIPT: exec /usr/bin/startkde
First NAME is the name of the wm, displayed in the desktop manager.
Then, the icon, but right now, no dm uses it. chksession
does not take it into account, for now.
DESC is the description, and is'nt shown either: it is ignored by the chksession
script.
Then, EXEC is the executable used to launch the program. The file should have the +x bit set in order to be taken into account. The rest of the file is the script used to launch the wm. In practice, you will always see almost the same line:
exec /usr/bin/start_the_wm
Adding a new Window Manager
All you have to do is to drop a session file in the /etc/X11/wmsession.d/
directory. Nowadays there is no more need to use %make_session in %post and %postun, this is automagically handled by RPM filetriggers
For consistency, a wm called mywm
should have a script called startmywm
, if a user wants to launch it from the command line without searching too much. The script can assume that it is launched with X initialized, by xinit
usually.
The name of the session file is always NNname
, with NN the position in the list, and name is the name as defined in the file. The first is KDE, and the ( current ) last is pekwm ( 30 ). Having 2 files with the same numbers is possible, but some programs ( for example: Xtart
) assume that no files have the same number. So, it is highly recommended to check with urpmf /etc/X11/wmsession.d/NN
that NN is not already taken.
Adding a new Display Manager
Add a file to describe the new display manager in /usr/share/X11/dm.d
. The filename must end in .conf
and begin with 2 digits.
This 2 digits number will be used to choose a dm when no DISPLAYMANAGER
or DESKTOP
variable has been defined in /etc/sysconfig/desktop
. The smaller number has the highest priority. You may wish that prefdm tries for your new dm before xdm
(always installed with X.org), then the number has to be less than 30.
urpmf /usr/share/X11/dm.d
can be used to check currently used filenames and numbers.
Here is /usr/share/X11/dm.d/10kdm.conf
for example:
NAME=KDM DESCRIPTION=KDM (KDE Display Manager) PACKAGE=kdm EXEC=/usr/bin/kdm FNDSESSION_EXEC="/usr/sbin/chksession -K"
Field | Explanation |
---|---|
NAME | unique key used by drakdm to write the DISPLAYMANAGER variable in /etc/sysconfig/desktop . So far the reserved keys are KDE, KDM, GNOME, XDM and E17
|
DESCRIPTION | text displayed in drakdm
|
PACKAGE | package installed by drakdm
|
EXEC | program to launch by /etc/X11/prefdm
|
FNDSESSION_EXEC | optional field to describe the command used to build the list of supported desktops for this display manager |
Nowadays a better example for the FNDSESSION_EXEC key would be the following, which generates standard session .desktop files to /usr/share/foodm/sessions
FNDSESSION_EXEC="/usr/sbin/chksession --generate=/usr/share/foodm/sessions"