Development/Howto/Wmsession

From Mandriva Community Wiki

Jump to: navigation, search
Wmsession Configuration

This page describes the uses of the /etc/X11/wmsession.d directory, for storing info about desktop managers.

Contents

[hide]


[edit] How it works

This directory is used to store the differents 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 configurations files, so to update their configuration, you should drop a file in the /etc/X11/wmsession.d directory and use %make_session in %post and %postun to update dm config.

%make_session only runs the program /usr/sbin/fndSession. It updates the configuration of kdm and of gdm.

If you plan to add a new dm, don't forget to patch this script.

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.

[edit] 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

[edit] Adding a new Window Manager

All you have to do is to drop a session file in the /etc/X11/wmsession.d/ directory, and use the %make_session in %post and %postun of your spec file.

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

[edit] Adding a new Display Manager

Add a file to describe the new display manager in /etc/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 /etc/X11/dm.d/ can be used to check currently used filenames and numbers.

Here is /etc/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
Personal tools