-->
Previous | Table of Contents | Next |
In X, you can display a bitmap image, a solid color, or a graphics file as your screen background, depending on the program you use to accomplish this task.
The xsetroot program sets the screen background color. It can also set the screen background to a monochrome bitmap. Our .xinitrc file sets the background color to SteelBlue. Other good screen background colors include bisque3 and MediumTurquoise. You can see the whole list of X color names in the text file /usr/lib/X11/rgb.txt. This file contains a number of entries, including:
255 239 213 PapayaWhip 255 235 205 BlanchedAlmond 50 205 50 LimeGreen
The xsetroot program can also be used to set the screen background to a monochrome bitmap, stored in an X bitmap file. The syntax for setting the screen background to a bitmap is:
gilbert:/$ xsetroot -bitmap filename -fg fore -bg back
where filename is the name of the file containing the bitmap and the fore and back are optional parameters that set the images foreground and background color, respectively. Use the color names from the rgb.txt file explained earlier.
For example, if you have an X bitmap file named prisoner.xb, you can set it to be tiled over the screen background with the following command:
gilbert:/$ xsetroot -bitmap prisoner.xb
Youll see a screen like that shown in Figure 3.8.
Figure 3.8 Using a bitmap as the screen background.
Because the image looks good in black and white, we skip the -fg and -bg options to xsetroot (and leave the famous penny-farthing bicycle alone).
If, instead of an X bitmap file, you have a GIF, TIFF, or JPEG image, you can use xv to display the image. Xv is a very neat image and file manager that sports the ability to convert images from one format to another and a way cool Visual Schnauzer. Normally, you display images in xvs window, but it can also display images on the screen background, also called the root window.
For xv, use the following syntax to display an image on the root window:
gilbert:/$ xv -quit -root -max filename
where filename is the name of the file you want to display. When you run this command on an image file, youll see a result like the one in Figure 3.9.
Figure 3.9 Using xv to set an image file for the screen background.
With complicated color images, you can soon fill up your colormap from the screen background image. This may lead to color flashing as X programs run out of colors in the default colormap and therefore create their own colormaps.
The window manager is one of the most important applications youll run, as it sits around every application window on the screen and can influence how the windows work. The de facto window manager for Linux is fvwm.
This window manager provides a great deal of control over the way you interact with X, especially because fvwm supports a host of configuration options. While you can run any window manager you want, fvwm seems to be the most popular in the Linux world. Its not documented in many places or X books, so well show you how to set up fvwm for your Linux system.
You can run only one window manager at a time.
Most window managers under X support a configuration file. Usually, this file is located in a dot file in your home directory. Most window managers also follow a naming convention for their configuration file. For the mwm window manager, the file is named .mwmrc. For twm, its .twmrc. For fvwm, its .fvwmrc.
At startup, fvwm will look for your customizations in a file named .fvwmrc in your home directory. If you have no .fvwmrc file (which is likely when you start out), fvwm will look for a system file named /usr/lib/X11/fvwm/system.fvwmrc. If that file, too, is missing, fvwm will exit.
Because fvwm is a very complex window manager, you should copy the system.fvwmrc file or one of the example files to your home directory and name it .fvwmrc. By starting from a working example, youll find it a lot easier than creating a .fvwmrc file from scratch.
Once you find the fvwm system directory, youll see a number of sample configurations in the sample_configs directory. Its easiest to configure fvwm from a working model, so you can either copy system.fvwmrc or one of the files in the sample_configs directory.
Once you have copied a working configuration file into your home directory, the next step is to start customizing. The .fvwmrc file is very long, so well provide an overview of the areas youre most likely to customize and then provide an example .fvwmrc filea very long examplethat you can use. Just browsing this example should give you plenty of ideas. In addition to our example, you may want to look at the fvwm example files mentioned earlier and look at fvwms online-manual page.
In the .fvwmrc file, the order of items is very important. Its best to start with a working example and then search for the items we mention. Change the items value, but leave the item itself in the same relative position in the .fvwmrc file.
Previous | Table of Contents | Next |