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

Father’s Day Gift Guide

Brand Post

Most Popular Reviews

Latest Articles


PCW Evaluation Team

Luke Hill


I need power and lots of it. As a Front End Web developer anything less just won’t cut it which is why the MSI GT75 is an outstanding laptop for me. It’s a sleek and futuristic looking, high quality, beast that has a touch of sci-fi flare about it.

Emily Tyson

MSI GE63 Raider

If you’re looking to invest in your next work horse laptop for work or home use, you can’t go wrong with the MSI GE63.

Laura Johnston

MSI GS65 Stealth Thin

If you can afford the price tag, it is well worth the money. It out performs any other laptop I have tried for gaming, and the transportable design and incredible display also make it ideal for work.

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Featured Content

Product Launch Showcase

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?