Installing a window manager

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 .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:

#./configure

#make

#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!

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

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

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.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Matthew Stivala

HP OfficeJet 250 Mobile Printer

The HP OfficeJet 250 Mobile Printer is a great device that fits perfectly into my fast paced and mobile lifestyle. My first impression of the printer itself was how incredibly compact and sleek the device was.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?