-->
Page 112
You'll find that rxvt supports at least one of the same command-line options as nxtermthe -e option to run programs in a standalone X Window. The -e option is useful if you want to run programs under X that are normally run from a non-graphical environment (the console), for example:
# rxvt -e pico &
This command line will run the pico editor (part of the pine mail program) in a standalone window. You can create, open, edit, and save files, but when you quit the pico editor, the window will disappear. This is a great way to run interactive console programs under X.
The rxvt client also supports a number of X Toolkit options, as you'll see in the next section. By using these options, you can start your rxvt terminal at any location of your desktop, with any available font, and with a selection of foreground and background colors.
A number of basic operations are important for you know about in using X11 and X11 clients. Many programs accept similar command-line options, so you can customize the size, color, and placement of client windows. This section introduces you to some of the more common command-line options and shows you how to use them.
TIME SAVER |
Not all X11 clients support the same X11 options, known as X Toolkit command-line options. For a full discussion of these options, see the X manual page, found under the /usr/X11/man/man1 directory, or an individual client's manual page for details. |
You can use the geometry option, usually in the form of -geometry widthxheight+xoffset+yoffset, to manage how and where your client's window will be displayed.
For example, if you want to start an rxvt terminal in the upper left corner of your screen, you would use
# rxvt -geometry 80x25+0+0 &
This command starts an 80-character, 25-line rxvt terminal, and places its window at the upper left corner of your display. Here's a neat trick: If you are using a virtual-window-
Page 113
capable window manager, and have several desktops available, you can start terminal emulators not only in your current desktop, but also in other desktops.
For example, if your current desktop is 800¥600, you can easily start other X11 clients in adjacent desktops by specifying the x and y offsets, as follows:
# rxvt -geometry 80x25+801+0 # rxvt -geometry 80x25+0+601
The first command line will start another terminal window, but at the upper left corner of the desktop immediately to the right. The second command line starts another terminal window, but at the upper left corner of the desktop immediately below. This is a handy feature to use if you want to set up not only your desktops, but others before you start X11. Using this approach, you can start word processing in one desktop, a Web browser in another, and a graphics program in a third (assuming you have enough memory).
The geometry specification is extremely useful for building organized, working screens. You can also use the very convenient "save desktop" features of the fvwm family of window managers to build your displays manually, and then save the window display settings to a file to be later edited into your .xinitrc window initializer file.
TIME SAVER |
The .xinitrc file usually resides in your home directory, and should be copied from the system xinitrc file, found in the /etc/X11/xinit directory. |
You can also usually set background and foreground colors for different parts of your X11 client's window with the -bg and -fg color command-line options. You'll find a list of colors supported by the XFree86 X11 servers in the file rgb.txt in the /usr/X11R6/lib/X11 directory. For example, to start the rxvt terminal emulator with a red background with yellow text for the foreground, you would use
# rxvt -bg red -fg yellow
If you're not using X11 in the 8bpp (8 bits per pixel) mode (256 colors) with the XF86_SVGA server, you'll find a more limited selection of colors available. For example, you'll only have 16 colors available if you use the XF86_VGA16 server, or only black and white if you use the monochrome server, XF86_Mono. You might also try to see the available colors by using the xcmap client, which displays the colors in a grid, and gives the rgb (red, green, and blue) values of the color in base 16, or hexadecimal (see the X and xcmap manual pages for more information). Another program to try is the showrgb client, which will automatically list the contents of the rgb database, rgb.txt.
Page 114
Other color options can include -bd for color choices of window borders, or the -rv and +rv reverse video modes, which are useful for monochrome displays.
The X Window System also supports further client configuration through the use of client resources. These are nothing more than text files that contain settings for different aspects of how a client looks or runs. You might also be able to set different resources of a client program when it first starts by using the -xrm command-line option to specify a resource string, but most programs will only use a resource file.
In order to change resource settings, you need to know what resources an X11 client uses. You can find this information by either reading the program's manual page, or looking for any installed settings in a file with (but not always) the client's name in the app-defaults directory under the /usr/X11R6/lib/X11 directory, as follows:
# ls -A /usr/X11R6/lib/X11/app-defaults Beforelight RXvt* XGetfile XPlaycd Xgc Bitmap Seyon XIdle XScreenSaver Xgopher Bitmap-color Seyon-color XLoad XSm Xgopher-color Chooser Viewres XLock XSysinfo Xloadimage Editres X3270 XLogo XSysinfo-color Xmag Editres-color XBanner XLogo-color XTerm Xman Fig XCalc XMailbox XTerm-color Xmessage Fig-color XCalc-color XMdb Xditview Xmh GV XClipboard XMem Xditview-chrtr Xvidtune GXditview XClock XMixer Xedit xosview Ghostview XConsole XPaint Xfd NXTerm XFontSel XPat Xfm
You can see that there are quite a few files with application default settings, but that not all of the more than 200 programs for X11 have settings installed. Each file contains resource strings for a particular X11 client. The resource strings can provide not only information that determines how a program is displayed, but the contents and handling of menus, buttons, or other parts of a program.
The format of resource strings is defined in the X manual page, but many X11 client manual pages will list different resources, with examples, for a particular client. For example, if you look at the resource settings for the xpaint drawing program's main toolbox, you'll see the following values:
... ! ! The top level operation/toolbox menu ! XPaint.width: 232 XPaint.height: 350 ...