Last month's LinuxWorld.com.au print section (page 144) examined five window managers for Linux as an alternative to the common GNOME and KDE desktops. In this Here's How column, we will look at setting up a new window manager, from installing the software to configuring X so it will be displayed.
INSTALLING THE PROGRAM First, copy any window manager to your hard drive (/tmp is an ideal location). If your system is RPM-compliant, then install the window manager software as root with:
$ rpm -Uvh
To install any program (not just a window manager) from its source code, you will need to compile binaries for your system before installing them. Since most programs distributed as source code are in tar-gzip format, unpacking is done with:
$ tar -zxvf
This will create a subdirectory with all the source code files in it. Note that tar archives can also have the .tgz extension. Change to the newly created directory and follow the installation directions in the README and/or INSTALL files. As a rule of thumb, compiling and installing the source code for a program will involve executing (as root) the sequence:
During each step a lot of code jargon will be echoed to the screen. This is normal and doesn't mean that things are going wrong. If each step reports no error messages, then the software will have been installed successfully on your system.
CONFIGURING X Once you have installed the window manager software, you need to tell X which window manager to begin upon startup. Typically, this is done by creating an executable file in your home directory. To do this, create a file called .xinitrc in your home directory with your favourite text editor and add the path to the window manager executables if they are installed on your system. These are the files that start the window manager and, as long as they are included in your default path, the full path to them is not necessary.
The hash "#" marks in front of the paths to the other window manager executables indicate that it will not be run when X is started. Next, make your .xinitrc file executable with:
$ chmod +x .xinitrc
and start X with the startx command. In this case, KDE will be the window manager which is started. To start another window manager, log out of your X session (use
If your system uses a graphical login, you can apply the same to a .xsession file in your home directory. When X is already started, the display manager (the screen that presents a graphical login) will treat any .xsession file in your home directory as an executable script. Therefore, you can start the window manager of your choice in the same way you would a .xinitrc file.
An important point to note about starting a window manager from the display manger: many distributions have a number of preset options, such as KDE and GNOME, which will start that application regardless of your .xsession file. To prevent this happening, make sure that "default" is the only option selected; this ensures your .xsession file will be run.
To make a permanent switch between a console-based login and a graphical display manger, you need to edit your /etc/inittab file. Login as root (type root at the login prompt and then enter your root password) and edit the /etc/inittab file with:
# pico /etc/inittab
Change the line that reads "id:5:"initdefault:" to "id:3:initdefault:" (or whichever numbers correspond to X11 and multi-user mode respectively) then save and exit the file by holding down