X(1X) — Commands
Digital
NAME
X − A network-transparent window system
DESCRIPTION
The X Window System, which consists of an X Server and a variety of X client applications, is network transparent, runs on workstations, and provides the capabilities to design 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, which can be located either on the same machine or elsewhere on the network.
The X Window System supports overlapping windows, fully recursive subwindows, and text and graphics operations within windows. One of the X window managers can be used to manipulate existing windows.
Normally, the X server is started by xdm, the X display manager, and therefore is automatically run when your system is in multiuser mode.
By default when you log in, only programs running on your local machine or those machines listed in a trusted-hosts database file 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(1X) command, or customize your security from the Session Manager.
The Display Option
Many X-based applications take a display option. The display option has one of the following formats:
−d[isplay] hostname
The display option specifies the display screen on which the X Server is to accept requests from X clients. If the display option is not specified, X uses the display screen specified by your DISPLAY environment variable. The display option has the format hostname:number.
hostnameSpecifies the name of the host machine on which the display is connected. You can specify the name unix or leave the field blank to use UNIX IPC, or the name of your host machine to use TCP.
numberSpecifies the number of the display on that host machine.
#Specifies the number of the screen on the host machine.
The default is :0.
Window Geometry
Most X client applications let you specify the size and position of the application window with the geometry option. The geometry option has the following 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 the corner of the screen from which each coordinate value is an offset, 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 you create 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 option is not specified, you can position the window with the mouse pointer and size it 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.
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 the format #RRGGBB.
Many X client applications also let you specify the font in which text is displayed. By default, the available fonts can be found in subdirectories of the /usr/lib/X11/fonts directory.
X Defaults
Most X-based applications read the .Xdefaults file during startup 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 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 toolkit-based application can consist of a combination of widgets (for example, push buttons and a scroll bar), you can form the name string, in addition to the application name, by adding widget class and name identifiers to the string.
In most cases, an asterisk (∗) should be used as a delimiter. An asterisk is similar to a wildcard character because it specifies that the definition applies even if any additional names and classes are omitted. A period delimiter (.) indicates an absolute widget pathname. When using a period, if you do not specify all widgets in the path, the specification will not work.
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 push button in the dxmail window to green:
dxmail∗PushButton∗background: green
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 assigns the background color of the Exit push button in the dxmail window to green:
dxmail∗Exit∗background: green
This example adds a name identifier (Exit) to the string.
The application name does not have to be part of the string. For example, the next two specifications assign the background color of button boxes. The first assigns all button boxes with the same class identifier in all toolkit-based applications to blue. The second assigns all button boxes with the name tocButtons in all toolkit-based applications to red:
∗ButtonBox∗background: blue
∗ButtonBox∗tocButtons∗background: red
Note
Default values may be modified by specific applications.
For information about the resources that can be specified for each X client application, see the reference page for that application.
The following is a sample .Xdefaults file that can be used as a template.
################################################################
#
# general defaults
#
################################################################
∗Font: helvetica_bold12
∗Text∗Font: helvetica12
∗Pushbutton.Font: helvetica_bold12
∗titlebar.Font: helvetica_bold12
∗ButtonBox.borderWidth: 1
∗ButtonBox.hSpace: 8
∗ButtonBox.Command.borderWidth: 0
∗ButtonBox.Command.internalWidth: 1
∗ButtonBox.Command.internalHeight: 1
#
# dxmail
#
dxmail∗debug: on
dxmail∗tocGeometry: 510x284+0+19
dxmail∗viewGeometry: 510x460+0+323
dxmail∗folders.Pushbutton.MarginWidth: 2
dxmail∗folders.Pushbutton.MarginHeight: 2
dxmail∗PrintCommand: enscript >2 /dev/null > /dev/null
dxmail∗ButtonBox∗Font: helvetica_bold12
Dxterm∗fontSetName: 6x13
Dxterm∗saveLinesOffTop: on
Dxterm∗screenMode: true
Dxterm∗autoWrapEnable: on
Dxterm∗autoRepeatEnable: on
Dxterm∗autoResize: on
Dxterm∗scrollVertical: on
#
# Session Manager
#
DXsession.create_terminal: 1
DXsession.startup_state: iconified
Key Bindings
Many X-based applications let you specify key-actions bindings for text input and editing operations. The DECwindows user interface provides basic text editing operations. In these text editing operations, a word is considered to be any contiguous string of characters that does not contain a word break character. Word break characters are as follows: space, tab, and line terminators. In addition, any contiguous string of identical word break characters (such as three spaces) is considered to be a word. The default text editing operations for all text windows are as follows:
Right arrowMoves the cursor one character to the right. In a single-line field, the cursor does not move when positioned at the end of the line. In a multi-line field, the cursor moves to the first position of the next line.
Left arrowMoves the cursor one character to the left. In a single-line field, the cursor does not move when positioned at the beginning of the line. In a multi-line field, the cursor moves to the last position of the previous line.
Up arrowIn a multi-line field, moves the cursor up one line.
Down arrowIn a multi-line field, moves the cursor down one line.
F11, F14Reserved.
F12Positions the cursor at the beginning of the line.
SHIFT/F12Positions the cursor at the end of the line.
F13Deletes the characters to the left of the cursor up to and including the beginning of the word, and shifts to the left all text to the right of the deleted character.
SHIFT/F13Deletes the characters to the right of the cursor up to and including the beginning of the word, and shifts to the right all text to the right of the deleted character.
DELETEDeletes the character before the cursor, and moves all text to the right of the deleted character one space to the left. DELETE works the same way in both insert and overstrike mode. When there is a selection, DELETE removes the selection but does not place it in the clipboard.
SHIFT/DELETEDeletes the character after the cursor, and moves all text to the right of the deleted character one space to the left. In overstrike mode, SHIFT/DELETE deletes the character under the block cursor.
A dialog box has one text insertion cursor, even if it has multiple text windows. Keys in a dialog box with multiple text windows take on the following additional actions:
TABMoves the cursor from the current field to the next field. If any text exists in the new field, it is automatically selected for pending delete.
SHIFT/TABMoves the cursor from the current field to the previous field. If any text exists in the new field, it is automatically selected for pending delete.
RETURNActivates the default push button (if there is one) in the dialog box.
ENTERActivates the default push button (if there is one) in the dialog box.
SHIFT/RETURNActivates the Cancel push button (if there is one) in the dialog box.
You can customize the basic text editing functions for text windows with the translations resource specified in the .Xdefaults file. This resource should be specified as:
∗Text.translations: key specification
Each key specification listed with the translations resource assigns an editor command to a named key 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. You can specify any of the following control keys (their abbreviations are in parentheses):
Ctrl (c)
Lock (l)
Meta (Compose Character) (m)
Shift (s)
You can specify the following mouse buttons:
Btn1 (by default, the left mouse button)
Btn2 (by default, the middle mouse button)
Btn3 (by default, the right mouse button)
You can assign the following actions to mouse buttons:
DownAction is invoked when the button is pressed.
UpAction is invoked when the button is released.
PtrMovedAction is invoked when the mouse button is down and the pointer is moved.
You can specify the following functions:
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-character
Deletes 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-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-paragraph
Kills 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 quotation marks or a string in double quotation marks. A string in quotation marks 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, insert the current selection into the text, and then insert the letter q when CTRL/Q is pressed.
cq:"abcdef" stuff ’q’
A sample set of key bindings in the .Xdefaults file is as follows:
#
# toolkit text bindings
#
set-insertion-point() select-start()
∗Text.translations: Ctrl<Key>f: forward-character()
Ctrl<Key>b:backward-character()
Meta<Key>f:forward-word()
Meta<Key>b:backward-word()
Meta<Key>]:forward-paragraph()
Ctrl<Key>[:backward-paragraph()
Ctrl<Key>a:beginning-of-line()
Ctrl<Key>e:end-of-line()
Ctrl<Key>n:next-line()
Ctrl<Key>p:previous-line()
Ctrl<Key>v:next-page()
Meta<Key>v:previous-page()
Meta<Key>\<:beginning-of-file()
Meta<Key>\>:end-of-file()
Ctrl<Key>z:scroll-one-line-up()
Meta<Key>z:scroll-one-line-down()
Ctrl<Key>d:delete-next-character()
Ctrl<Key>h:delete-previous-character()
~Shift Meta<Key>d: delete-next-word()
~Shift Meta<Key>h: delete-previous-word()
Ctrl<Key>w:kill-selection()
Meta<Key>y:stuff()
Ctrl<Key>m:newline()
Ctrl<Key>l:redraw-display()
Any<Key>:self-insert()
Meta<Btn1Down>:extend-start()
Meta Button1<PtrMoved>: extend-adjust()
Meta<Btn1Up>:extend-end()
Meta<Btn2Down>:stuff()
RESTRICTIONS
If options not listed in appropriate X server reference page are used, the server may fail.
FILES
~/.Xdefaults
RELATED INFORMATION
bitmap(1X), dxcalendar(1X), dxcardfiler(1X) dxmail(1X), dxnotepad(1X), dxterm(1X), xedit(1X), xfd(1X), xhost(1X), xload(1X), xmh(1X), xset(1X), xsetroot(1X), xwininfo(1X), Xws(8X) /usr/bindx
/usr/bin/X11