How To Set Xterm Display In Linux
viii
Command Line Options
This chapter describes command-line options that are mutual to most clients. Some arguments to control-line options can also be specified every bit the values of resource variables, described in Chapter 9. For example, the format of a geometry string or a color specification is the same whether it is specified equally an argument to an option or as the value of a resources definition.
In This Chapter:
Which Display to Run On
Title and Name
Window Geometry
Border Width
Colour Specification
The rgb.txt File
Release 4 Color Names
Release 3 Colour Names
Alternative Release 4 Colour Databases
Hexadecimal Color Specification
The RGB Color Model
How Many Colors are Available?
Starting a Client Window equally an Icon
Specifying Fonts on the Control Line
Opposite Video
eight
Control Line Options
X allows the user to specify numerous (very numerous!) command line options when starting nigh clients. The command line options for each client are detailed on the reference pages in Part 3 of this guide.
Equally a general rule, all options can be shortened to the shortest unique abbreviation. For example, -brandish
can be shortened to -d
if there is no other option beginning with "d." (Note that while this is true for all the standard MIT clients, it may non be true of any random client taken off the net.)
In addition to certain client-specific options, all applications built with the X Toolkit accept sure standard options, which are listed in Table viii-1. (Some non-Toolkit applications may also recognize these options.) The first column gives the proper name of the option, the 2nd the proper noun of the resources to which it corresponds (see Chapter ix, Setting Resources), and the third a brief description of what the selection does. This chapter discusses some of the more commonly used Toolkit options and demonstrates how to employ them. (For the syntax of the other Toolkit options, see the X reference page in Function Iii of this guide.)
The options -selectionTimeout
and -xnllanguage
are available as of Release 4.
Tabular array 8-i. Standard Options
Though all Toolkit options are preceded by a minus sign, customer-specific options may or may not require it. Meet the reference page for each client in Part Three of this guide for the syntax of all options.
Which Display to Run On
By and large, the results of a client program are displayed on the system where the client is running. However, if yous are running a client on a remote organization, you probably want to display the results on your local server.
An option of the form:
-display [host] : server[.screen]
tin be used to tell a client which server to display results on.
The host
specifies on which automobile to create the window, the server
specifies the server number, and the screen
specifies the screen number. Annotation that the server
parameter e'er begins with a colon (a double colon after a DECnet node*), and that the screen parameter always begins with a period. If the host is omitted or is specified every bit unix
, the local node is assumed. If the screen is omitted, screen 0 is assumed.
xterm and other X clients ordinarily get the host, server, and screen from the Brandish surroundings variable. (In near configurations, Display volition be set to the local host, server 0 and screen 0.)
However, you may want to specify the host, server, and screen explicitly. You can exercise this for all clients past resetting the value of the DISPLAY variable, or for a single invocation of a client by using the -display
pick.
For case:
% xterm -display other_node: 0.0 &
creates an xterm window on screen 0 of server 0 on the motorcar named other_node
.
Although much of the electric current X Window Organisation documentation suggests that any of the parameters to the -display
pick tin can be omitted and will default to the local node, server and screen 0, respectively, we have non found this to be truthful. In our experience, only the host
and screen
parameters (and the flow preceding screen
) tin exist omitted. The colon and server
are necessary in all circumstances.
The -brandish
option can be abbreviated equally -d
.
Championship and Name
The name of the program (as known to the server) and the title of the window can be specified on the command line. The -title
option allows you to specify a text string as the championship of the application'south window. If your application has a titlebar, or if the window managing director yous are using puts titlebars on windows, this string will appear in the titlebar. Window titles can be useful in distinguishing multiple instances of the same application.
The -name
option actually changes the proper noun past which the server identifies the program. Changing the proper noun of the application itself (with the -proper noun
option) affects the way the application interprets resources files. This option is discussed farther in Chapter 9, Setting Resource. If a name string is divers for an awarding, that string will announced as the awarding proper noun in its icon.
If you lot display data about currently running windows using the xwininfo or xlswins client, title strings volition appear in parentheses subsequently the associated window ID numbers. (If there is no championship string, just there is a name string, the proper noun string will be displayed.)
__________
*Past convention, DECnet node names end with a colon.
Yous tin can as well use the xwininfo client to request data about a particular window by title, or proper noun, if no title string is defined, using that application's own -proper noun
choice. Run across the xlswins and xwininfo reference pages in Office Iii and the section "Window and Brandish Data Clients" in Affiliate 7, Other Clients, to learn more about these clients.
Window Geometry
All clients that display in a window take a geometry pick that specifies the size and location of the client window. The syntax of the geometry option is:
-geometry geometry
The -geometry
option tin be (and frequently is) abbreviated to -grand
, unless there is a conflicting choice that begins with "g."
The parameter to the geometry pick ( geometry
), referred to as a "standard geometry cord," has the course:
widthxsummit±xoff±yoff
The variables, width, peak, xoff
(10 offset), and yoff
(y get-go) are values in pixels for many clients. Yet, application developers are encouraged to use units that are meaningful to the application. For example, xterm uses columns and rows of text as width and height values in the xterm window.
You can specify any or all elements of the geometry string. Incomplete geometry specifications are compared to the resources managing director defaults and missing elements are supplied by the values specified there. If no default is specified there, and twm is running, the window manager volition require you to identify the window interactively.
The values for the x and y offsets and their effects are shown in Tabular array 8-ii.
Tabular array 8-two. Geometry specification x and y offsets
For example, the control line:
% xclock -geometry 125x125-10+10 &
places a clock 125x125 pixels in the upper-right corner of the display, 10 pixels from both the top and right edge of the screen.
For xterm, the size of the window is measured in characters and lines. (The default size is 80 characters broad past 24 lines long.) If you wanted to use a large VT100 window, 120 characters wide past xl lines long, you could use the post-obit geometry specification:
% xterm -geometry 120x40-10+350 &
This command places the large xterm window in the lower-correct comer, 10 pixels from the right edge of the screen and 350 pixels from the top of the screen. Figure viii-1 illustrates window offsets.
Effigy 8-1. Window offsets
Several clients, including xterm, allow you to set the size and position of the icon or culling window using resources variables (in an .Xdefaults or other resources file). Encounter the advisable client reference pages in Part 3 of this guide for a complete listing of available resource. Refer to Chapter 9, Setting Resources, for instructions on how to prepare resources.
Y'all should be aware that, equally with all user preferences, yous may not e'er become exactly what you enquire for. Clients are designed to work with a window manager, which may accept its ain rules for window or icon size and placement. Still, priority is always given to specific user requests, so you lot won't often be surprised.
Border Width
Many clients as well allow you to specify the width of the border to exist placed around the window. The edge width is specified in pixels. For example:
% xterm -bw 10 &
sets a border of ten pixels effectually the xterm window.
You will have to experiment to get a feeling for the translation between the number of pixels and bodily sizes and distances. It will vary, depending on the type of workstation you are using.
If you are experimenting with geometry measurements, use the xwininfo client to display information about windows on the screen.
At the control line prompt in an xterm window, type:
% xwininfo
and then click on the window for which you lot want to brandish data. You should encounter a display which gives various characteristics almost the window in question. The statistics almost relevant to window geometry are listed below, with some typical readings:
Upper left 10: 572
Upper left Y: 582
Width: 578
Height: 316
Depth: 1
Border width: 1
Corners: +572+582 -0+582 -0-0 +572-0
All numerical data is in pixels, except depth, which is in bits per pixel. (Run into the give-and-take of color later in this affiliate for the significance of window depth.) The upper left Ten and Y coordinates are particularly useful for setting the location of a window using the geometry option. Upper left X corresponds to the positive x offset (+xoff
) and upper left Y corresponds to the positive y offset (+yoff
).
The four comers are listed with the upper left comer kickoff and the other three clockwise around the window (i.e., upper right, lower right, lower left). The upper left comer (first in the list) e'er gives the positive x and y offsets for the window. In other words, the upper left comer specification is the +xoff+yoff
part of the geometry string.
The width and height in pixels are somewhat less useful, since the geometry pick to xterm requires that these figures be specified in characters and lines. The readings above are for a standard size xterm window using a 12 point Roman Courier font. However, you will undoubtedly become accustomed to thinking in terms of pixels by specifying the geometry of other clients.
See the xwininfo reference page in Office 3 and the section "Window and Display Data Clients" in Chapter 7, Other Clients, for more details.
Color Specification
Many clients have options that allow you to specify the colour of the window border, background, and foreground (the color text or graphic elements will be displayed in). These options by and large have the course:
-bg color
Sets the groundwork color.
-fg color
Sets the foreground colour.
-bd color
Sets the border color.
By default, the background of an awarding window is usually white and the foreground black, even on color workstations. You can specify a new color using either the color names listed in a system file called rgb.txt or hexadecimal values representing colors.
In the side by side department, we'll have a expect at some of the colors available in the rgb.txt file. For now, let's consider the syntax of a command line specifying an xterm to be displayed in three colors:
% xterm -bg lightblue -fg darkslategrey -bd plum &
This command creates an xterm window with a background of light blue, foreground of dark slate grey, and window border of plum (all colors are bachelor in both Releases 3 and 4).
At the command line, a color name should be typed equally a single give-and-take (for example, darkslategrey
). Withal, you can type the words comprising a color name separately if you lot enclose them in quotes, as in the following command line:
% xterm -bg "low-cal blue" -fg "dark slate grey" -bd plum &
As nosotros'll see, the rgb.txt file contains variants of the same colour name (for example, "navy blue" and "NavyBlue," or "gray" and "gray") to allow a range of spelling, spacing, and capitalization on the command line.
Some clients allow boosted options to specify color for other elements, such as the cursor, highlighting, so on. Run into the appropriate client reference pages in Part Three of this guide for details.
The rgb.txt File
The rgb.txt file, usually located in /usr/lib/X11, is supplied with the standard distribution of X and consists of predefined colors assigned to specific text names.
A corresponding compiled file called rgb.dir contains the definitions used by the server; this auto-readable file serves as a colour name database, and is discussed more fully in Appendix A, System Management. The rgb.txt file is the human-readable equivalent.
Release 4 Colour Names
The default rgb.txt file shipped with Release 4 of X contains 738 colour proper noun definitions. This number is slightly deceptive, since as we've said, a number of the color names are merely variants of some other color proper name (differing simply in spelling, spacing and capitalization).
Still, the number of colors available in Release 4 is more than double the number available in Release 3. Some of the Release iv colors are entirely new (like snowfall and misty rose), but many are just slightly different shades of colors available in prior releases.
For case, the Release 3 rgb.txt file includes the color sea greenish. The Release 4 rgb.txt file offers the following shades of that color:
calorie-free ocean green
sea greenish
medium ocean dark-green
dark bounding main green
SeaGreen1
SeaGreen2
SeaGreen3
SeaGreen4
DarkSeaGreen1
DarkSeaGreen2
DarkSeaGreen3
DarkSeaGreen4
Each of these names corresponds to a color definition. (This list does not include the variants SeaGreen, LightSeaGreen, MediumSeaGreen, and DarkSeaGreen, which also appear in the file.) Equally you tin run into, some of these shades are distinguished in the fairly traditional way of being called "light," "medium," and "dark." The light, medium, and dark shades of a color can probably be distinguished from i some other on virtually whatsoever monitor.
Beyond this distinction, there are what might exist termed "sub-shades;" gradations of a detail shade identified by number (SeaGreen1, SeaGreen2, etc.). Numerically adjacent subshades of a color may not be conspicuously distinguishable on all monitors. For case, SeaGreen1 and two may wait very much the same. (You certainly would not choose to create a window with a SeaGreen1 background and SeaGreen2 foreground! On the other mitt, subshades a couple of numbers apart are probably sufficiently dissimilar to exist used on the aforementioned window.)
By supplying many different shades of a unmarried, already fairly precise colour similar bounding main greenish, Ten developers accept tried to provide definitions that work well on a variety of normally-used monitors.* Yous may take to experiment to make up one's mind which colors (or shades) brandish best on your monitor.
The color names in the Release 4 rgb.txt file are too numerous to list hither. Although there are no literal dividers inside the file, it tin roughly be considered to fall into three sections:
__________
*The color database shipped with prior releases of X was originally designed to display optimally on the vt240 series terminals manufactured by Digital Equipment Corporation.
Section i: | A standard spectrum of colors, many available in or similar to colors in Release 3 (such as sea light-green). These colors seem to be ordered roughly as follows: off-whites and other pale colors, greys, blues, greens, yellows, browns, oranges, pinks, reds, and purples. |
Department 2: | Sub-shades of Section one colors (such every bit SeaGreen 1 through iv). These sub-shades contain the largest role of the file. |
Section 3: | Ane hundred and 1 additional shades of grey, numbered 0 through 100 (as well available in Release 3). This large number of precisely graduated greys provides a wide multifariousness of shading for monochrome screens. |
Rather than list every color in the rgb.txt file, we've compiled the following table of representative colors. We've chosen some of the more esoteric color names. Naturally, all of the primary and secondary colors are bachelor also.
Section i:
Section two:
Section 3:
grey0 (gray0)
through grey100 (gray100)
If yous want to expect more closely at the rgb.txt file, y'all can open it with any text editor. Every bit an alternative, you can also display the contents of the file using the showrgb client. showrgb seems to do nada more than true cat(1) the file to your terminal window. Given the size of the file, information technology's necessary to pipe the control's output to a paging programme, such as pg(1) or more(1).
% showrgb | more
See Appendix A, Arrangement Management, for information on customizing color name definitions.
Release 3 Color Names
The following are the default color names shipped with Release 3 of the X Window Organisation. Again, this list does not include the many variants of these names.
Alternative Release 4 Color Databases
In addition to the standard colour database described higher up, Release 4 also includes three other databases that can be compiled by your system administrator. These files tin be plant in the general release in the directory ./rgb/others.
raveling.txt | Designed by Paul Raveling, this database rivals the default database in size and telescopic, just has been tuned to brandish optimally on Hewlett-Packard monitors. |
thomas.txt | Based on the Release 3 database, this file has been modified by John Thomas of Tektronix to approximate the colors in a box of Crayola Crayons. |
erstwhile-rgb.txt | This is zero more than the Release 3 database. |
Hexadecimal Colour Specification
You can also specify colors more exactly using a hexadecimal color string. You probably won't apply this method unless y'all require a color not bachelor by using a colour proper name. In lodge to understand how this works, you may need a fiddling background on how color is implemented on most workstations.
The RGB Colour Model
Virtually color displays on the market today are based on the RGB colour model. Each pixel on the screen is actually made up of three phosphors: one red, one green, and one blue. Each of these three phosphors is excited by a split up electron axle. When all three phosphors are fully illuminated, the pixel appears white to the human middle. When all iii are nighttime, the pixel appears blackness. When the illumination of each primary colour varies, the three phosphors generate a subtractive color. For case, equal portions of red and green, with no admixture of blueish, makes yellowish.
As you might approximate, the intensity of each chief color is controlled by a three-part digital value—and information technology is the exact makeup of this value that the hexadecimal specification allows y'all to fix.
Depending on the underlying hardware, unlike servers may use a larger or smaller number of bits (from 4 to 16 bits) to describe the intensity of each chief. To insulate you from this variation, most clients are designed to take color values containing anywhere from 4 to 16 bits (1 to 4 hex digits), and the server then scales them to the hardware. As a effect, y'all can specify hexadecimal values in any one of the following formats:
#RGB
#RRGGBB
#RRRGGGBBB
#RRRRGGGGBBBB
where R, Yard, and B represent single hexadecimal digits and decide the intensity of the crimson, green, and blue primaries that make upward each colour.
When fewer than iv digits are used, they stand for the most pregnant bits of the value. For instance, #3a6 is the same as #3000a0006000.*
What this means concretely is peradventure best illustrated by looking at the values that represent to some colors in the color proper noun database. We'll use 8-bit values—two hexadecimal digits for each primary. The following definitions are the hexadecimal equivalents of the decimal values for some of the colors found in the rgb.txt file:
#000000 blackness
#FFFFFF white
#FF0000 ruby
#00FF00 green
#0000FF blue
#FFFF00 yellow
#00FFFF cyan
#FF00FF magenta
#5F9EA0 cadet blue
#6495ED cornflower blueish
#ADD8E6 light blue
#B0C4DE light steel bluish
#0000CD medium blue
#000080 navy blueish
#87CEED sky blue
#6A5ACE slate bluish
#4682B4 steel blue
__________
*If you are unfamiliar with hexadecimal numbering, run across the Glossary for a cursory explanation, or a basic computer textbook for a more extended discussion.
Equally you can run into from the colors given above, pure red, dark-green, and blue upshot from the corresponding $.25 being turned full on. All primaries off yields blackness, while all virtually full on gives white. Yellowish, cyan, and magenta can exist created by pairing two of the other primaries at full intensity. The diverse shades of blue shown above are created by varying the intensity of each master—sometimes in unexpected ways.
The bottom line here is that if y'all don't intimately know the physics of colour, the best yous can do is to expect upwards existing colors from the color proper noun database and experiment with them by varying one or more of the primaries till you find a color you like. Unless you need precise colors, yous are probably better off using color names.
How Many Colors are Available?
The number of distinct colors available on the screen at whatsoever ane fourth dimension depends on the amount of memory available for color specification. (The xdpyinfo client provides information about a brandish, including the number of colors available at 1 fourth dimension. Come across Chapter 7, Other Clients, and the xdpyinfo reference page in Part Three for details.)
A color brandish uses multiple bits per pixel (also referred to as multiple planes or the depth of the display) to select colors. Programs that depict in color utilise the value of these bits every bit a pointer to a lookup tabular array called a colormap, in which each entry (or colorcell) contains the RGB values for a particular color.* Equally shown in Figure 8-2, whatsoever given pixel value is used equally an index into this tabular array—for case, a pixel value of 16 will select the sixteenth colorcell.
Why is this technical particular important? Considering information technology explains several issues that you might come across in working with color displays.
First, the range of colors possible on the display is a function of the number of $.25 available in the colormap for RGB specification. If eight $.25 is available for each principal, and so the range of possible colors is 256iii (somewhere over 16 meg colors). This means that you tin create incredibly precise differences between colors.
Withal, the number of unlike colors that can be displayed on the screen at whatever once is a function of the number of planes. A iv-airplane system tin can index 2iv colorcells (sixteen distinct colors); an eight-plane system tin can index twoeight colorcells (256 distinct colors); and a 24-plane organization can index 224 colorcells (over sixteen meg distinct colors).
If you are using a four-plane workstation, the fact that you can precisely define hundreds of different shades of blueish is far less significant than the fact that you can't use them all at the same fourth dimension. In that location isn't space for all of them to be stored in the colormap at one time, or any mechanism for them to exist selected even if they could be stored.
__________
*In that location is a type of high-end display in which pixel values are used straight to command the illumination of the cherry, green, and bluish phosphors, but far more than commonly, the bits per pixel are used indirectly, with the bodily color values specified independently, as described here.
Figure 8-two. Multiple planes used to index a colormap
This limitation is made more than significant by the fact that Ten is a multi-client environment. When X starts up, unremarkably no colors are loaded into the colormap. As clients are invoked, sure of these cells are allocated. But when all of the free colorcells are used upward, it is no longer possible to request new colors. When this happens, you will normally be given the closest possible colour from those that have already been allocated. Even so, y'all may instead be given an error message and told that there are no complimentary colorcells.
In order to minimize the chance of running out of colorcells, many programs use "shared" colorcells. Shared colorcells tin can be used by any number of applications, but they can't be changed past any of them. They can only be deallocated by each application that uses them, and when all applications have deallocated the jail cell, information technology is bachelor for setting 1 once again. Shared cells are most often used for groundwork, border, and cursor colors.
Alternately, some clients take to be able to modify the color of graphics they have already fatigued. This requires another kind of cell, chosen private, which can't be shared. A typical use of a private cell would be for the pallete of a color mixing awarding. Such a program might have three bars of each primary colour, and a box which shows the mixed color. The primary bars would utilise shared cells, while the mixed colour box would use a private cell.
In summary, some programs define colorcells to be read-only and shareable, while others define colorcells to be read/write and private.
To height it off, there are even clients that may temporarily bandy in a whole individual colormap of their ain. Because of the mode color is implemented, if this happens, all other applications will exist displayed in unexpected colors.
In society to minimize such conflicts, you should request precise colors just when necessary. By preference, use color names or hexadecimal specifications that y'all specified for other applications.
Starting a Client Window as an Icon
The -iconic
command line option starts the client window in iconified form. To commencement an xterm window every bit an icon, blazon:
% xterm -iconic &
This can be especially useful for starting the login xterm window. As described in Chapter 2, Getting Started, terminating the login xterm window kills the Ten server and all other clients that are running. It's e'er possible to terminate a window inadvertently, by selecting the incorrect menu option or typing the incorrect central sequence. If your login xterm window is automatically iconified at startup, you are far less probable to terminate the window inadvertently and end your X session.
For most clients, the size and position of the icon can be set using resources variables in an .Xdefaults or other resources file. (This is highly recommended if you are starting the login xterm window as an icon.) Run into the appropriate client reference pages in Part Three for a complete listing of available resources. Refer to Chapter 9, Setting Resources, for instructions on how to set up resources.
Specifying Fonts on the Command Line
Many clients allow yous to specify the font to be used when displaying text in the window. (These are known as screen fonts and are not to be confused with printer fonts.) For clients written with the X Toolkit, the option to set the brandish font is -fn
. For case, the control line:
% xterm -fn fontname &
creates an xterm window in which text will be displayed with the font named fontname.
Affiliate 5, Font Specification, describes the bachelor screen fonts and font naming conventions.
Contrary Video
There are three options to control whether or not the awarding volition display in reverse video—that is, with the foreground and groundwork colors reversed. The -rv
or -reverse
option is used to request reverse video.
The +rv
option is used to override whatever reverse video request that might be specified in a resource file (encounter Chapter 9, Setting Resources). This is important, considering not all clients handle reverse video correctly, and even those that do usually exercise so only on black and white displays.
How To Set Xterm Display In Linux,
Source: https://www.oreilly.com/library/view/x-window-system/9780937175149/Chapter08.html
Posted by: savoiefurepought.blogspot.com
0 Response to "How To Set Xterm Display In Linux"
Post a Comment