-->
Previous Table of Contents Next


xgrab

xgrab is an interactive front end for xgrabsc, an X Windows image grabber. xgrab was written by Bruce Schuchardt ([email protected]) and many other people, who retain a loose copyright on the program. xgrab lets you grab arbitrary rectangular images from an xserver and writes them to files or commands (such as lpr) in a variety of formats.

Read the man page for xgrabsc for a description of the options presented by xgrab. After selecting options from the various categories presented, click OK to have xgrab run xgrabsc to let you grab an image from the screen. After you click OK, xgrab’s window disappears, and xgrabsc gains control until the grabbing process is finished. Afterward, the xgrab window reappears.

xgrab responds to the standard application options, such as -_display. See the man page for X Windows for a complete list. You can also override the default xgrab settings in your .Xdefaults file. See the “Examples” section for instructions.

Resources

The xgrab resource file, XGrab.ad, contains a complete specification of the resources of all the widgets used in the xgrab window. Widgets are resource specifications for such items as buttons and menus. Global resources, such as default font and color, are at the bottom of the file.

Examples

The ToCommand output option may be used to pipe xgrabsc output to programs. The most common commands are lpr for PostScript output and xwud for X Windows Dump output. Programs that don’t accept piped input shouldn’t be used with ToCommand.


TIP:  You can also get fancy and pipe the output through more than one command, such as tee screen.dmp| xwud, to store the grabbed image and get a preview window.

Default settings for xgrab can be made in your .Xdefaults file. For the Athena toolkit version of xgrab, toggle buttons can be set or unset through their .state attribute, and text-field strings can be set through their *string attribute. For the Motif toolkit version, which has diamond-shaped buttons for radio buttons, toggle buttons can be set or unset through their .set attribute and text-field strings can be set through their *value attribute. For example, to set the default paper size for PostScript output, put these lines in .Xdefaults (use xrdb to load them into the server):


XGrab*.pageWidthText*string: 8.5

XGrab*.pageHeightText*string: 11.0

or


XGrab*.pageWidthText*value: 8.5

XGrab*.pageHeightText*value: 10.0

To set the default output type to XWD, put these lines in .Xdefaults:


XGrab*.ps.state: 0

XGrab*.xwd.state: 1

xlock

Patrick J. Naughton ([email protected]) wrote xlock and released it to the world. The xlock program locks the local X Windows display until the user enters their password at the keyboard. While xlock is running, all new server connections are refused, the screen saver is disabled, the mouse cursor is turned off, and the screen is blanked and a changing pattern is put on-screen. If a key or a mouse button is pressed, the user is prompted for the password of the user who started xlock.

If the correct password is entered, the screen is unlocked and the X server is restored. When you’re typing the password, <Ctrl-Shift-u> and <Ctrl-Shift-h> are active as kill and erase commands, respectively. To return to the locked screen, click the small icon version of the changing pattern.

Having Fun with DOOM for Linux

The best is always saved for last. Why run XFree86 under Linux? Because ID Software, Inc. has made a version of their shareware game DOOM available. While superseded by other first-person shooter games (such as Id Software’s Quake), DOOM is an enthralling shoot-’em-up adventure game still played the world over. Using realistic 3-D graphics, you’re a space marine going into an unholy, terror-filled space colony located on one of the moons of Mars. You must find your way through the labs and various sites, looking for your lost comrades. All you find instead are hideous monsters and other space marines who have turned against you.

The X Windows version supplied on the accompanying Slackware CD-ROM in the /contrib directory is a complete shareware version. (The Red Hat distribution automatically installs the game during installation.) Although this version runs on 386 computers, it was built to run on high-end 486 systems. If you run DOOM on a 386 with a small amount of physical RAM, be prepared to be disappointed; the game will be too slow to be enjoyable. You need lots of horsepower to play DOOM under Linux.

Installing DOOM

DOOM is installed by default with the Red Hat distribution and can be started by selecting xdoom from the Start, Programs, Games menu.

Under Slackware, DOOM is stored in a series of archived files under the ///slackware/y2 directory. If you chose to install the games package while installing Linux, DOOM should already be installed. If not, you can use pkgtool to install it now, or you can perform the following steps:

1.  Copy the archived files under the ///slackware/y2 directory to an area on your hard drive.
2.  Change the directory to the base directory you want to use. The archives will extract the files to the usr/games/doom directory, so you may as well copy all the files in the doom directory on the accompanying Slackware CD-ROM to /usr with the following commands:

   cd /usr

   cp /cdrom/contrib/linuxdoom/*.

3.  Decompress each file in the directory with this command:

   zip -d filename


where filename is the name of each file in the directory. This command creates two tar files.
4.  Unarchive each file with the tar command to create the necessary directories and files:

   tar -xfv archive-file


See “Using tar,” p. 229


Previous Table of Contents Next