Some notes on X


The X Window System, of which XFree86 is a free implementation of, is currently at version X11R6.


Window Managers control the appearance of windows and provide a means by which the user can interact with them.


Changing window manager.  (Not for all, but most common)

'xinit' actually starts the X Window System, but usually needs certian options.  'startx' is a script which sets up variables, preforms any needed tasks specific to the local system, then calls xinit.  If startx is avalible, use it, otherwise you have to use xinit.

Startx uses a configuration file.  It will try to use the users config file and if it is not present then it will use the system config file.  You can find the name of these files by looking in the startx script.  Make sure you are looking at the right script bu using 'which startx'

Location
system location varies from system to system but will be something like /etc/X11/xinit/xinitrc
user location is almost always ~/.xinitrc

Look in the system file xinitrc to see where it calls the default window manager and edit appropriately.  It is safest to edit the users ~/.xinitrc.  Make sure the scriptends with "exec [windowmanager]".  a simple script would be:
    #!/bin/sh
    exec fvwm

The exec command is used to replace the script process with the process of the window manager itself.  This is because X shuts down when the script finishes running, but if the window manager replaces it, it will shut down when the window manager quits instead.

***
I checked Mandrake 9.0.  The last line in /etc/X11/xinit/xinitrc was:
    exec /etc/X11/Xsession $*

what does this mean?
***


Running X from  a graphical login such as XDM


XDM is the X Display Manager.  It starts X when the machine boots up and provides a graphical login box instaed of the command line.  Configuration is simular but now the files are:
system - /etc/X11/xdm/Xsession
user - ~/.Xsession

Note : CDE uses DTWM which operates differently.

There are some more note here