Installing a window manager

Last month's 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 .rpm

where is replaced by the name, version number and build of the actual window manager you are installing. Most popular window managers have RPM packages available. If your system is not RPM-compliant, or there are no RPM packages available, you will need to compile it from source.

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

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:



#make install

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 the window manager won't log you out), place a hash in front of startkde and remove (un-comment) another of your choice. This method applies to any window manager and not just the ones mentioned here.

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 and pressing X. Answer yes to the question by pressing Y and finally pressing . This will give you a console every time you reboot your computer and, once logged in, executing startx will begin X.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Rodney Gedda

PC World
Show Comments

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Tom Pope

Dynabook Portégé X30L-G

Ultimately this laptop has achieved everything I would hope for in a laptop for work, while fitting that into a form factor and weight that is remarkable.

Tom Sellers


This smart laptop was enjoyable to use and great to work on – creating content was super simple.

Lolita Wang


It really doesn’t get more “gaming laptop” than this.

Jack Jeffries


As the Maserati or BMW of laptops, it would fit perfectly in the hands of a professional needing firepower under the hood, sophistication and class on the surface, and gaming prowess (sports mode if you will) in between.

Taylor Carr


The MSI PS63 is an amazing laptop and I would definitely consider buying one in the future.

Christopher Low

Brother RJ-4230B

This small mobile printer is exactly what I need for invoicing and other jobs such as sending fellow tradesman details or step-by-step instructions that I can easily print off from my phone or the Web.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?