5. Customizing the X Server

Contents of this section

The ``X server'' is the program that knows how to draw windows on your screen, read keypresses from the keyboard, and read points, clicks, and drags from the mouse. All of these parts together are called the ``X display''. The X server allows some degree of customization of the display using the xset program.

5.1 Changing X Display Settings

Some of the settings you can change using `xset' are:

Turning the Beep On or Off

If you don't want the X display to beep (for instance, when you send a control-G or ``bell'' character to xterm), you can turn it off using:

xset b off

to turn the beep on, use:

xset b on

Mouse Acceleration

If you want to ``accelerate'' mouse motion (so that you don't have to move the mouse very far to move the cursor from one edge of the screen to the other), you can change the acceleration:

xset m <multiplier>

<Multiplier> is a number (such as `4' or `3/2') such that, when you move the mouse fast, it travels that many times further than normal.

The Default Screensaver

If you want the builtin screensaver to come on after a certain amount of inactivity, you can turn it on or change the time period that it waits. To turn on the screensaver, use the following command:

xset s on

To make sure the screen is blanked, use:

xset s blank

To change the number of seconds after which to activate the screensaver, use:

xset s <number-of-seconds>

Notes and Pointers

NOTE that these settings will only affect the current X Windows session. If you want to change the settings every time you use X Windows, put the commands in your .Xclients script (you don't need to run xset in the background).

See the manual page for xset for more information.

5.2 Changing Root Window Settings

In X Windows, the ``root window'' is the first window that gets created; all other windows get drawn on top of it. In effect, the root window acts as a ``backdrop'' for your X session.

The root window has several properties that you can change to suit your taste:

Root Window Color

To set the color of the root window to gray, use the following command:

xsetroot -gray

To set the color of the root window to any solid color, use the following command:

xsetroot -solid <color>

<Color> is either the name or the hexadecimal value of a color. For example, both of the following are equivalent:

xsetroot -solid white
xsetroot -solid '#ffffff'

You can find names of colors in the ``RGB database'', located in /usr/X11R6/lib/X11/rgb.txt.

Mouse Cursors

You can change the shape of the mouse cursor when it is above the root window (this doesn't change the cursor when it is above other windows) using the following command:

xsetroot -cursor_name <cursorname>

<Cursorname> is one of the ``standard'' X Windows mouse cursor shapes. Here is a list of some interesting ones to try out:

xsetroot -cursor_name draped_box
xsetroot -cursor_name hand1
xsetroot -cursor_name hand2
xsetroot -cursor_name iron_cross
xsetroot -cursor_name left_ptr
xsetroot -cursor_name plus
xsetroot -cursor_name top_left_arrow
xsetroot -cursor_name watch

In fact, you can use this feature of xsetroot in your .Xclients script to show a watch cursor while your clients are starting up, and then change it to a cursor of your liking just before the end of the script. For example:

#!/bin/sh
#
# .Xclients:  startup script for X Windows
#       
# show a watch cursor to indicate 
# that we're starting things up
xsetroot -cursor_name watch
#
# start clock
xclock &
#
# (other X clients here)
#
# change to a regular pointer to show 
# that we're ready for use
xsetroot -cursor_name top_left_arrow
#
# and finally, start window manager
exec fvwm
#
# -------- End of .Xclients --------

The full list of cursors is available in the X Windows include file /usr/X11R6/include/X11/cursorfont.h; each cursor shape is called XC_<cursorname>---you should leave off the XC_ prefix when using these names with xsetroot.

Notes and Pointers

NOTE that, much like xset the above commands will only affect the current X Windows session. If you want to change the settings every time you start X Windows, put the commands in your .Xclients script (you don't need to run xsetroot in the background).

For more information, see the manual page for xsetroot. For information about putting color graphic pictures (``wallpaper'') in the root window, see the manual page for xv (from the xv package) and xpmroot (from the fvwm package).


Next Chapter, Previous Chapter

Table of contents of this chapter, General table of contents

Top of the document, Beginning of this Chapter