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.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
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

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.

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?