X(1X)
NAME
X - A network-transparent Window System
SYNTAX
X display [ options ] tty
ARGUMENTS
displaySpecifies the display screen on which the X Server is to accept requests from X clients. If the display argument is not specified, X uses the display screen specified by your DISPLAY environment variable. The display argument has the format hostname:number.
hostnameSpecifies the name of the host machine on which the display is connected. You can specify the name local to use shared memory, the name unix to use UNIX IPC, or the name of your host machine to use TCP.
numberSpecifies the number of the display on that host machine.
ttySpecifies the terminal device file on which the X Server is to run.
DESCRIPTION
The X Window System, which consists of an X Server and a variety of X client applications, is network transparent, runs on computers with bitmap terminals, and provides hooks for a variety of user interface styles. Within the X Window System, the X Server distributes user input to and accepts output requests from the various X client programs that can be located either on the same machine or elsewhere in the Internet.
The X Window System supports overlapping windows, fully recursive subwindows, and text and graphics operations within windows. Use one of the X system window managers to manipulate existing top level windows.
The command that executes the X Server usually is specified in the /etc/ttys file and, therefore, is automatically running when your system is in multiuser mode. Consequently, when you first log in on a display running X, you actually are using the xterm terminal emulator program, which interacts directly with the X Server.
By default when you log in, only programs running on your local computer are allowed to interact with the X Server that is connected to your display. To allow programs running remotely to interact with your display, use the xhost command.
In addition to explaining the options that can be specified on the X command line, the following topics about the X Window System are discussed:
•The color manager
•Window geometry
•User interface
•Keyboard remapping
•Colors and fonts
•X defaults
•Key bindings
OPTIONS
−a numSets the mouse acceleration value to the specified number of pixels. The default is 4.
−cTurns off key-clicking.
c numSets the key-click volume to the specified number (0-8). The default is 6.
−cm numSets the color manager. If set to 0, turns off the color manager. If set to 1, turns on the color manager and specifies that the first two colormap entries WhitePixel and BlackPixel are not reserved. If set to 2, turns on the color manager and specifies that these colormap entries are reserved. The recommended value is 2. The default is 0.
−f numSets the bell volume to the specified number (0-7). The default is 3.
−lSets LockUpDownMode.
lSets LockToggleMode. The default is on.
mForces monochrome mode on a color display.
−rTurns off auto-repeating.
rTurns on auto-repeating. The default is on.
−s numSets the screen-saver timeout value to the specified number of minutes. The default is 10.
−t numSets the mouse threshold to the specified number of pixels. The default is 2.
−0 colorSets color map entry 0 (BlackPixel) to the specified color. The default is #000080 (light blue).
−1 colorSets color map entry 1 (WhitePixel) to the specified color. The default is #ffffff.
−D fileSets the RGB database to the specified file. The default is /usr/lib/rgb.dir or /usr/lib/rgb.pag.
−w numSets the time that X blocks on full client input buffers to the specified number of seconds. The default is 20.
THE COLOR MANAGER
The color manager lets the active window on screen access the entire colormap. When the color manager is not running, client applications have less colors available to them because:
•Client applications must share read-only colors with other clients.
•Writable colors are accessed exclusively by the client application that has allocated them.
The last two colormap entries (254 and 255) on a GPX system are used for the cursor.
If a window appears blank, move the cursor into the window to write colormap entries to the hardware colormap.
Applications that call the Xlib XQueryColor function (for example, savimg) may not work as expected when the color manager is running. Applications that do not call this function, however, are not affected by the color manager.
When the color manager is enabled, resimg can be used with the −cm option specified.
WINDOW GEOMETRY
Most X client applications let you specify the size and position of the application window with the geometry argument. The geometry argument is to be specified on the command line at application start up in the format: =[width][xlength][x][y]
widthSpecifies the number of pixels the window spans horizontally.
lengthSpecifies the number of pixels the window spans vertically.
xSpecifies the x screen coordinate (pixel value) for the starting corner of the window.
ySpecifies the y screen coordinate (pixel value) for the starting corner of the window.
Depending on which corner of the screen each is relative to, the x and y coordinates must be preceded by a plus (+) or a minus (−). The following lists the four screen corners and the required positive or negative state for the x and y coordinates when creating a window with respect to that corner.
Upper left corner+x +y
Lower left corner+x −y
Upper right corner−x +y
Lower right corner−x −y
If the geometry argument is not specified, the window can be positioned with the mouse pointer and sized with one of the mouse buttons. For sizing information specific to an application, see the reference page for that application.
Most X client applications read options (such as font and border width) to control the sizing of their initial window. For information about options specific to an application, see the reference page for that application.
USER INTERFACE
The X Toolkit-based applications provide a consistent graphical user interface. The main components of this user interface include:
•Scroll bars
•Resizing knobs
•Command buttons
•Text input boxes
•Text selection
Scroll Bars
The X Toolkit-based applications provide scroll bars with which you can scroll through the text displayed in an application window. A scroll bar contains a highlighted slide bar that, when repositioned, displays scrolled text.
The position of the highlighted slide bar indicates the portion of the text that you are viewing. The size of the highlighted slide bar is relative to the amount of text that exists and indicates how much more can be displayed.
To display text, position the mouse pointer on the scroll bar and click one of the following mouse buttons:
Left Scrolls the text or information to the right of the mouse pointer up to the top of the window.
Middle Scrolls the corresponding text to the pointer location.
Right Scrolls the text at the top of the window down to a position that is to the right of the mouse pointer.
Resizing Knobs
The X Toolkit-based applications provide resizing knobs (boxes) with which you can change the size of an area displayed in an application window. A resizing knob is located to the right of each area that can be resized.
To use a resizing knob, follow this procedure:
1.Place the mouse pointer on the appropriate resizing knob.
2.Press and hold one of the three mouse buttons (see below).
3.Position the mouse pointer at the appropriate location.
4.Release the mouse button.
The mouse buttons and their corresponding actions are:
Left Adjusts the size of the area above the knob
Middle Adjusts the location of the corresponding border
Right Adjusts the size of the area below the knob
When using the left or right mouse buttons to change the size of an area, the size of other window areas may also change. When using resizing knobs, you cannot resize an area to an illegal size. That is, if you attempt to resize an area that makes an adjacent area either too small or too large, the application resizes the area to its legal limit only.
Command Buttons
The X Toolkit-based applications provide command buttons (rectangular boxes) that let you execute specific application commands.
To select a command button, follow this procedure:
1.Place the mouse pointer on the command button.
2.Click (press and release) any mouse button.
Text Input Boxes
Many X Toolkit-based applications provide input boxes that let you provide additional information for the command to be invoked.
To enter text in the input box, position the mouse pointer inside the box and begin typing. To delete this text, backspace over it by using the DELETE key. In some cases, you first may have to position the mouse pointer before you can begin deleting text. To position the mouse pointer, move the mouse pointer to the appropriate position and click the left mouse button. Then, begin deleting. For further information, see the specific User Guide.
Text Selection
The X Toolkit-based applications let you select and copy text between any windows on your screen.
To select text, you can follow one of two procedures. The first procedure is:
1.Position the mouse pointer at the beginning of the text to be selected.
2.Press and hold the left mouse button.
3.Move the mouse pointer directly to the end of the text to be selected.
4.Release the left mouse button.
The second procedure is:
1.Position the mouse pointer on the text to be selected.
2.Click (press and release) the left button the appropriate number of times in quick succession.
To select a word, click the left mouse button two times. To select a line, click the left mouse button three times. To select all window text (only in some applications), click the left mouse button five times.
To copy selected text, follow this procedure:
1.Place the mouse pointer in the appropriate window.
2.Click (press and release) the middle mouse button or press both the Compose key and the letter “y” key (depending on the application).
KEYBOARD REMAPPING
The keyboard on most displays can be remapped. To remap your keyboard, use the keycomp program.
COLORS AND FONTS
Many X client applications let you specify colors for background, border, text, and so on. A color specification can be given either as an English name (see /usr/lib/rgb.txt for defined names), or three hexadecimal values for the red, green, and blue components, in one of the following formats:
#RGB
#RRGGBB
#RRRGGGBBB
#RRRRGGGGBBBB
Many X client applications also let you specify the font in which text is displayed. Available fonts are listed in /usr/lib/Xfont.
X DEFAULTS
Most X-based applications read the .Xdefaults file during start-up and use the appropriate resource specifications to customize the appearance or characteristics of their windows. The format for a resource specification in the .Xdefaults file is:
[name.]resource:value
nameSpecifies the application name or, in the case of X Toolkit-based applications, the name string that restricts the resource assignment to that application or to a component of an application. If this argument is not specified, the resource assignment is globally available to all X applications.
resourceSpecifies the X resource.
valueSpecifies the value that is to be assigned to the resource.
Because each X Toolkit-based application can consist of a combination of widgets (for example, command buttons and a scroll bar), the name string, in addition to the application name, can be formed by adding widget class and name identifiers (each delimited by a period) to the string.
When you add a widget class identifier to the name string, you make the resource available to every occurrence of that widget in the application. For example, the following assigns the background color of every command button in the xmh window to blue:
xmh.Command.background: blue
When you add a widget name identifier to the name string, you make the resource available to the specific widget (component) with that name in the application. For example, the following assign the background color of the Quit command button in the xmh window to red:
xmh.Command.quit.background: red
xmh.quit.background: red
Although both examples make the same resource assignment, they are formatted differently. The first example adds both a class identifier (Command) and a name identifier (quit) to the string. The second example adds only the name identifier (quit) to the string.
Although the application name can be part of the string, it also can be omitted. For example, the next two specifications assign the background color of command buttons. The first assigns all command buttons with the same class identifier in all toolkit-based applications to blue. The second assigns all Quit command buttons with the same name identifier in all toolkit-based applications to red.
Command.background: blue
Command.quit.background: red
For information about the resources that can be specified for each X client application, see the appropriate reference page for that application.
When changing your .Xdefault file, it is a good practice to precede all program defaults (restricted to the named application) in the file with all global defaults (apply to all X clients).
KEY BINDINGS
Each specification included in the .XtActions file modifies a key setting for the editor that X Toolkit-based applications use. When specifying key specifications, the following resource specification must be placed in your .Xdefaults file:
text.EventBindings: .XtActions
Each key specification assigns an editor command to a named key and/or mouse combination and has the format:
key: function
keySpecifies the key or mouse button that is used to invoke the named function.
functionSpecifies the function to be invoked when the named key is pressed.
The default specifications in the .XtActions file are:
<Ctrl>F: forward-character
<Key>168: forward-character
<Ctrl>B: backward-character
<Key>167: backward-character
<Meta>F: forward-word
<Meta>B: backward-word
<Meta>]: forward-paragraph
<Ctrl>[: backward-paragraph
<Ctrl>A: beginning-of-line
<Ctrl>E: end-of-line
<Ctrl>N: next-line
<Key>169: next-line
<Ctrl>P: previous-line
<Key>170: previous-line
<Ctrl>V: next-page
<Meta>V: previous-page
<Meta>\<: beginning-of-file
<Meta>\>: end-of-file
<Ctrl>Z: scroll-one-line-up
<Meta>Z: scroll-one-line-down
<Ctrl>D: delete-next-character
<Ctrl>H: delete-previous-character
<Key>113: delete-previous-character
<Key>188: delete-previous-character
<Meta>D: delete-next-word
<Meta>H: delete-previous-word
s<Meta>D: kill-word
s<Meta>H: backward-kill-word
<Ctrl>W: kill-selection
<Ctrl>K: kill-to-end-of-line
<Meta>K: kill-to-end-of-paragraph
<Ctrl>Y: unkill
<Meta>Y: stuff
<Ctrl>J: newline-and-indent
<Key>115: newline-and-indent
<Ctrl>O: newline-and-backup
<Ctrl>M: newline
<Key>189: newline
<Ctrl>L: redraw-display
<Meta>I: insert-file
<BtnDown>left: select-start
<PtrMoved>left: extend-adjust
<BtnUp>left: extend-end
<BtnDown>right: extend-start
<PtrMoved>right: extend-adjust
<BtnUp>right: extend-end
Any of the following control keys (abbreviations in parentheses) can be specified:
Ctrl (c)
Lock (l)
Meta (Compose Character) (m)
Shift (s)
The following mouse buttons can be specified:
Left
Middle
Right
The actions that you can assign to each mouse button are:
BtnDownAction is invoked when the button is pressed.
BtnUpAction is invoked when the button is released.
PtrMovedAction is invoked when the mouse button is down and the pointer is moved.
The following functions can be specified:
backward-characterMoves backward one character.
backward-kill-wordKills the word before the insertion point. This text can be recovered with the unkill function.
backward-paragraphMoves backward one paragraph.
backward-wordMoves backward one word.
beginning-of-fileMoves to the beginning of the text.
beginning-of-lineMoves to the beginning of the current line.
delete-next-characterDeletes the character after the insertion point.
delete-next-wordDeletes the word after the insertion point.
delete-previous-characterDeletes the character before the insertion point.
delete-previous-wordDeletes the word before the insertion point.
delete-selectionDeletes the selection.
end-of-fileMoves to the end of the text.
end-of-lineMoves to the end of the current line.
extend-adjustAdjusts the extension of the selected text.
extend-endEnds the extension of the selected text.
extend-startBegins the extension of the selected text.
forward-characterMoves forward one character.
forward-paragraphMoves forward one paragraph.
forward-characterMoves forward one character.
forward-paragraphMoves forward one paragraph.
forward-wordMoves forward one word.
insert-fileInserts a file into the text.
kill-selectionKills the selection. This text can be recovered with the unkill function.
kill-to-end-of-lineKills from the insertion point to the end of the line. This text can be recovered with the unkill function.
kill-to-end-of-paragraphKills from the insertion point to the end of the paragraph. This text can be recovered with the unkill function.
kill-wordKills the word after the insertion point. This text can be recovered with the unkill function.
newline-and-backupCreates a new paragraph, leaving the insertion point on the previous one.
newline-and-indentCreates a new paragraph with the same indentation as the current one.
newlineCreates a new paragraph.
next-lineMoves down one line.
next-pageMoves to the next screen of text.
previous-lineMoves up one line.
previous-pageMoves to the previous screen of text.
redraw-displayRepaints the window.
scroll-one-line-downScrolls the text down one line.
scroll-one-line-upScrolls the text up one line.
select-adjustAdjusts the selection.
select-allSelects all the text.
select-endEnds the selection.
select-startBegins the selection.
select-wordSelects the word the insertion point is in.
stuffInserts the text that was last selected from any window.
unkillInserts the text that was last killed. (There is no way to get back text that was deleted.)
A function specification can also include a character in single quotes or a string in double quotes. A string in quotes instructs the application to insert the specified string into the file. For example, the following function instructs the application to insert the string abcdef into the text, stuff the current selection into the text, and then insert the letter q when CTRL-q is pressed.
cq:"abcdef" stuff ’q’
FILES
~/.Xdefaults
~/.XtActions
/usr/lib/.Xdefaults
/usr/lib/.XtActions
SEE ALSO
bitmap(1X), keycomp(1X), twm(1X), uwm(1X), xclock(1X), xedit(1X), xfd(1X), xhost(1X), xload(1X), xset(1X), xterm(1X), xmh(1X), xwininfo(1X)