-->

Previous | Table of Contents | Next

Page 121

followed by the word on. To set the time in seconds, use the s option, followed by the number of seconds you want your X11 server to wait to blank the screen, for example:


# xset s 60

This will set the timeout interval to 60 seconds before the X11 screensaver is activated. To test the screensaver, which is built into your X11 server, you can then use the s option with the word activate, for example:


# xset s on

# xset s activate

This will display a blank screen. If you'd like to see a graphic and background pattern, you can use the noblank option for xset's s command-line option, for example:


# xset s noblank

# xset s activate

As you can see, you'll find a large X displayed on the screen. To turn off screensaving, use the s off command-line option. If this isn't your idea of a screensaver, you can try the xscreensaver clients.

The xscreensaver and xscreensaver-command clients, by Jamie Zawinski, are found under the /usr/X11R6/bin directory. The xscreensaver client has 16 command-line options. Although this hour doesn't cover all of the options, the basic way to use this screensaver is to first run the xscreensaver client in the background as follows:


# xscreensaver -timeout 5 &

This command will set the screensaver to run after five minutes of no keyboard or mouse activity. You can control this client with the xscreensaver-command client, to turn the xscreensaver on or off, or to activate it immediately. Although the xscreensaver client has a -lock option to password-protect your display, you'll have to recompile the program to enable this feature.

The xscreensaver client comes with nearly two dozen different screensavers, which can also be run as standalone programs. For example, you can run the fractal drawing program, hopalong, in a window with


# hopalong

This will run the screensaver in a window so you can see what it looks like. For a list of the screensavers that will work with the xscreensaver client, read the file XScreenSaver in the
/usr/X11R6/lib/X11/app-defaults directory. You'll find other settings in the file, which is the X11 resources file for this client.

You might also be interested in the xlock client. Although it is not a screensaver, xlock is a sophisticated terminal-locking program with nearly 50 command-line options and more

Page 122

than 50 different displays built in. The xlock client is helpful if you want to password-protect your display to prevent others from using your computer while you're away.

By default, after you start the xlock program, you must enter your password before you can use your display again. But you can use it as a simple screensaver without password protection to display a variety of animations, for example:


# xlock -duration 10 -nolock -mode random

This command line tells the xlock program to display a random selection of its animations, each of which will run for 10 seconds.

JUST A MINUTE
The xlock client can also make your desktop an animated display if you use the -inroot command-line option. This won't protect your system, but you might find the visuals stimulating!

Exploring X11 Programs

There's not enough room in this hour to discuss all of the X11 clients on your CD-ROM. You will find discussions about different clients throughout the rest of this book, but this section shows you some helpful programs that will give you more information about your system, and some tips and tricks on how to use them.

Listing X11 Fonts with xlsfonts

If you'd like a list of all the fonts recognized by X11 on your system, you can use the xlsfonts client. You'll want to use a pager like less or more (discussed in Hour 4, "Reading and Navigation Commands") if you call the client without any options. You can also use wildcards or patterns to match font names. This can be handy to find a particular font on your system, for example:


# xlsfonts -fn *italic*

lucidasans-bolditalic-10

lucidasans-bolditalic-10

lucidasans-bolditalic-12

lucidasans-bolditalic-12

lucidasans-bolditalic-14

lucidasans-bolditalic-14

lucidasans-bolditalic-18

lucidasans-bolditalic-18

lucidasans-bolditalic-24

lucidasans-bolditalic-24

lucidasans-bolditalic-8

lucidasans-bolditalic-8

lucidasans-italic-10

Page 123


lucidasans-italic-10

lucidasans-italic-12

lucidasans-italic-12

lucidasans-italic-14

lucidasans-italic-14

lucidasans-italic-18

lucidasans-italic-18

lucidasans-italic-24

lucidasans-italic-24

lucidasans-italic-8

lucidasans-italic-8

As you can see, this lists all the italic fonts installed or recognized by your X11 server. You can use the xlsfonts client to troubleshoot whether or not fonts are recognized or installed, or to find a font name to choose as a X Toolkit option when starting a client.

Getting Window Information with the xwininfo Client

You can use the xwininfo client, or window information utility, to get helpful information about a window. When you use this command, you can click on a another window to get a detailed information listing, for example:


# xwininfo

 xwininfo: Please select the window about which you

          would like information by clicking the

          mouse in that window.



After you click the desired window, you'll see a list of information, such as the following:


xwininfo: Window id: 0xc00002 "rxvt"



 Absolute upper-left X:  8

 Absolute upper-left Y:  397

 Relative upper-left X:  0

 Relative upper-left Y:  0

 Width: 574

 Height: 158

 Depth: 8

 Visual Class: PseudoColor

 Border width: 0

 Class: InputOutput

 Colormap: 0x21 (installed)

 Bit Gravity State: ForgetGravity

 Window Gravity State: NorthWestGravity

 Backing Store State: NotUseful

 Save Under State: no

 Map State: IsViewable

 Override Redirect State: no

 Corners:  +8+397  -218+397  -218-45  +8-45

 -geometry 80x11+3-40



This information can be helpful, for example, if you'd like to get the specifications about a window's geometry settings for the next time you run the program, or if you'd like to change the default behavior of a window by editing its resource file.

Previous | Table of Contents | Next