.TH X 1 "Release 4" "X Version 11" .SH NAME X - a portable, network-transparent window system .SH SYNOPSIS .PP The X Window System is a network transparent window system developed at MIT which runs on a wide range of computing and graphics machines. The core distribution from MIT has support for the following operating systems: .sp .ce 11 Ultrix 3.1 (Digital) SunOS 4.0.3 (Sun) HP-UX 6.5 (Hewlett-Packard) Domain/OS 10.1 (HP/Apollo) A/UX 1.1 (Apple) AIX RT-2.2 and PS/2-1.1 (IBM) AOS-4.3 (IBM) UTEK 4.0 (Tektronix) NEWS-OS 3.2 (Sony; client only) UNICOS 5.0.1 (Cray; client only) UNIX(tm) System V, Release 3.2 (AT&T 6386 WGS; client only) .sp It should be relatively easy to build the client-side software on a variety of other system. Commercial implementations are also available for a wide range of platforms. .PP The X Consortium requests that the following names be used when referring to this software: .sp .ce 5 X .br X Window System .br X Version 11 .br X Window System, Version 11 .br X11 .PP .I "X Window System" is a trademark of the Massachusetts Institute of Technology. .SH DESCRIPTION X Window System servers run on computers with bitmap displays. The server distributes user input to and accepts output requests from various client programs through a variety of different interprocess communication channels. Although the most common case is for the client programs to be running on the same machine as the server, clients can be run transparently from other machines (including machines with different architectures and operating systems) as well. .PP X supports overlapping hierarchical subwindows and text and graphics operations, on both monochrome and color displays. For a full explanation of the functions that are available, see the \fIXlib - C Language X Interface\fP manual, the \fIX Window System Protocol\fP specification, the \fIX Toolkit Intrinsics - C Language Interface\fP manual, and various toolkit documents. .PP The number of programs that use \fIX\fP is growing rapidly. Of particular interest are: a terminal emulator (\fIxterm\fP), a window manager (\fItwm\fP), a display manager (\fIxdm\fP), mail managing utilities (\fIxmh\fP and \fIxbiff\fP), a manual page browser (\fIxman\fP), a bitmap editor (\fIbitmap\fP), access control programs (\fIxauth\fP and \fIxhost\fP), user preference setting programs (\fIxrdb\fP, \fIxset\fP, \fIxsetroot\fP, and \fIxmodmap\fP), a load monitor (\fIxload\fP), clocks (\fIxclock\fP and \fIoclock\fP), a font displayer (\fIxfd\fP), utilities for listing information about fonts, windows, and displays (\fIxlsfonts\fP, \fIxfontsel\fP, \fIxlswins\fP, \fIxwininfo\fP, \fIxlsclients\fP, \fIxdpyinfo\fP, and \fIxprop\fP), a diagnostic for seeing what events are generated and when (\fIxev\fP), screen image manipulation utilities (\fIxwd\fP, \fIxwud\fP, \fIxpr\fP, and \fIxmag\fP), and various demos (\fIxeyes\fP, \fIico\fP, \fImuncher\fP, \fIpuzzle\fP, \fIxgc\fP, etc.). .PP Many other utilities, window managers, games, toolkits, etc. are available from the user-contributed software. See your site administrator for details. .SH STARTING UP .PP There are two main ways of getting the X server and an initial set of client applications started. The particular method used depends on what operating system you are running and on whether or not you use other window systems in addition to X. .TP 8 .B "\fIxdm\fP (the X Display Manager)" If you want to always have X running on your display, your site administrator can set your machine up to use the X Display Manager \fIxdm\fP. This program is typically started by the system at boot time and takes care of keeping the server running and getting users logged in. If you are running \fIxdm\fP, you will see a window on the screen welcoming you to the system and asking for your username and password. Simply type them in as you would at a normal terminal, pressing the Return key after each. If you make a mistake, \fIxdm\fP will display an error message and ask you to try again. After you have successfully logged in, \fIxdm\fP will start up your X environment. By default, if you have an executable file named \fI.xsession\fP in your home directory, \fIxdm\fP will treat it as a program (or shell script) to run to start up your initial clients (such as terminal emulators, clocks, a window manager, user settings for things like the background, the speed of the pointer, etc.). Your site administrator can provide details. .TP 8 .B "\fIxinit\fP (run manually from the shell)" Sites that support more than one window system might choose to use the \fIxinit\fP program for starting X manually. If this is true for your machine, your site administrator will probably have provided a program named "x11", "startx", or "xstart" that will do site-specific initialization (such as loading convenient default resources, running a window manager, displaying a clock, and starting several terminal emulators) in a nice way. If not, you can build such a script using the \fIxinit\fP program. This utility simply runs one user-specified program to start the server, runs another to start up any desired clients, and then waits for either to finish. Since either or both of the user-specified programs may be a shell script, this gives substantial flexibility at the expense of a nice interface. For this reason, \fIxinit\fP is not intended for end users. .SH "DISPLAY NAMES" .PP From the user's prospective, every X server has a \fIdisplay name\fP of the form: .sp .ce 1 \fIhostname:displaynumber.screennumber\fP .sp This information is used by the application to determine how it should connect to the server and which screen it should use by default (on displays with multiple monitors): .TP 8 .I hostname The \fIhostname\fP specifies the name of the machine to which the display is physically connected. If the hostname is not given, the most efficient way of communicating to a server on the same machine will be used. .TP 8 .I displaynumber The phrase "display" is usually used to refer to collection of monitors that share a common keyboard and pointer (mouse, tablet, etc.). Most workstations tend to only have one keyboard, and therefore, only one display. Larger, multi-user systems, however, will frequently have several displays so that more than one person can be doing graphics work at once. To avoid confusion, each display on a machine is assigned a \fIdisplay number\fP (beginning at 0) when the X server for that display is started. The display number must always be given in a display name. .TP 8 .I screennumber Some displays share a single keyboard and pointer among two or more monitors. Since each monitor has its own set of windows, each screen is assigned a \fIscreen number\fP (beginning at 0) when the X server for that display is started. If the screen number is not given, then screen 0 will be used. .PP On POSIX systems, the default display name is stored in your DISPLAY environment variable. This variable is set automatically by the \fIxterm\fP terminal emulator. However, when you log into another machine on a network, you'll need to set DISPLAY by hand to point to your display. For example, .sp .in +8 .nf % setenv DISPLAY myws:0 $ DISPLAY=myws:0; export DISPLAY .fi .in -8 .PP Finally, most X programs accept a command line option of \fB-display \fIdisplayname\fR to temporarily override the contents of DISPLAY. This is most commonly used to pop windows on another person's screen or as part of a "remote shell" command to start an xterm pointing back to your display. For example, .sp .in +8 .nf % xeyes -display joesws:0 -geometry 1000x1000+0+0 % rsh big xterm -display myws:0 -ls ResourceSpec = WhiteSpace ResourceName WhiteSpace ":" WhiteSpace value ResourceName = [Binding] ComponentName {Binding ComponentName} Binding = "\&." | "*" WhiteSpace = {" " | "\\t"} ComponentName = {"a"\-"z" | "A"\-"Z" | "0"\-"9" | "_" | "-"} value = string string = {} .fi .PP Note that elements enclosed in curly braces ({\&.\&.\&.}) indicate zero or more occurrences of the enclosed elements .PP To allow values to contain arbitrary octets, the 4-character sequence \\\fInnn\fP\^, where n is a digit in the range of "0"\-"7", is recognized and replaced with a single byte that contains this sequence interpreted as an octal number. For example, a value containing a NULL byte can be stored by specifying "\\000". .PP The \fIXlib\fP routine .I XGetDefault(3X) and the resource utilities within Xlib and the X Toolkit Intrinsics obtain resources from the following sources: .TP 8 .B "RESOURCE_MANAGER root window property" Any global resources that should be available to clients on all machines should be stored in the RESOURCE_MANAGER property on the root window using the \fIxrdb\fP program. This is frequently taken care of when the user starts up X through the display manager or \fIxinit\fP. .TP 8 .B "application-specific files" Programs that use the X Toolkit Intrinsics will also look in the directories named by the environment variable XUSERFILESEARCHPATH or the environment variable XAPPLRESDIR, plus directories in a standard place (usually under /usr/lib/X11/, but this can be overridden with the XFILESEARCHPATH environment variable) for application-specific resources. See the \fIX Toolkit Intrinsics - C Language Interface\fP manual for details. .TP 8 .B XENVIRONMENT Any user- and machine-specific resources may be specified by setting the XENVIRONMENT environment variable to the name of a resource file to be loaded by all applications. If this variable is not defined, a file named \fI$HOME\fP/.Xdefaults-\fIhostname\fP is looked for instead, where \fIhostname\fP is the name of the host where the application is executing. .TP 8 .B \-xrm \fIresourcestring\fP Applications that use the X Toolkit Intrinsics can have resources specified from the command line. The \fIresourcestring\fP is a single resource name and value as shown above. Note that if the string contains characters interpreted by the shell (e.g., asterisk), they must be quoted. Any number of \fB\-xrm\fP arguments may be given on the command line. .PP Program resources are organized into groups called \fIclasses\fP, so that collections of individual resources (each of which are called \fIinstances\fP) can be set all at once. By convention, the instance name of a resource begins with a lowercase letter and class name with an upper case letter. Multiple word resources are concatenated with the first letter of the succeeding words capitalized. Applications written with the X Toolkit Intrinsics will have at least the following resources: .PP .TP 8 .B background (\fPclass\fB Background) This resource specifies the color to use for the window background. .PP .TP 8 .B borderWidth (\fPclass\fB BorderWidth) This resource specifies the width in pixels of the window border. .PP .TP 8 .B borderColor (\fPclass\fB BorderColor) This resource specifies the color to use for the window border. .PP Most applications using the X Toolkit Intrinsics also have the resource \fBforeground\fP (class \fBForeground\fP), specifying the color to use for text and graphics within the window. .PP By combining class and instance specifications, application preferences can be set quickly and easily. Users of color displays will frequently want to set Background and Foreground classes to particular defaults. Specific color instances such as text cursors can then be overridden without having to define all of the related resources. For example, .sp .nf bitmap*Dashed: off XTerm*cursorColor: gold XTerm*multiScroll: on XTerm*jumpScroll: on XTerm*reverseWrap: on XTerm*curses: on XTerm*Font: 6x10 XTerm*scrollBar: on XTerm*scrollbar*thickness: 5 XTerm*multiClickTime: 500 XTerm*charClass: 33:48,37:48,45-47:48,64:48 XTerm*cutNewline: off XTerm*cutToBeginningOfLine: off XTerm*titeInhibit: on XTerm*ttyModes: intr ^c erase ^? kill ^u XLoad*Background: gold XLoad*Foreground: red XLoad*highlight: black XLoad*borderWidth: 0 emacs*Geometry: 80x65-0-0 emacs*Background: #5b7686 emacs*Foreground: white emacs*Cursor: white emacs*BorderColor: white emacs*Font: 6x10 xmag*geometry: -0-0 xmag*borderColor: white .fi .PP If these resources were stored in a file called \fI.Xresources\fP in your home directory, they could be added to any existing resources in the server with the following command: .sp .nf % xrdb -merge $HOME/.Xresources .fi .sp This is frequently how user-friendly startup scripts merge user-specific defaults into any site-wide defaults. All sites are encouraged to set up convenient ways of automatically loading resources. See the \fIXlib\fP manual section \fIUsing the Resource Manager\fP for more information. .SH "EXAMPLES" The following is a collection of sample command lines for some of the more frequently used commands. For more information on a particular command, please refer to that command's manual page. .sp .nf % xrdb -load $HOME/.Xresources % xmodmap -e "keysym BackSpace = Delete" % mkfontdir /usr/local/lib/X11/otherfonts % xset fp+ /usr/local/lib/X11/otherfonts % xmodmap $HOME/.keymap.km % xsetroot -solid '#888' % xset b 100 400 c 50 s 1800 r on % xset q % twm % xmag % xclock -geometry 48x48-0+0 -bg blue -fg white % xeyes -geometry 48x48-48+0 % xbiff -update 20 % xlsfonts '*helvetica*' % xlswins -l % xwininfo -root % xdpyinfo -display joesworkstation:0 % xhost -joesworkstation % xrefresh % xwd | xwud % bitmap companylogo.bm 32x32 % xcalc -bg blue -fg magenta % xterm -geometry 80x66-0-0 -name myxterm $* .fi .SH DIAGNOSTICS A wide variety of error messages are generated from various programs. Various toolkits are encouraged to provide a common mechanism for locating error text so that applications can be tailored easily. Programs written to interface directly to the \fIXlib\fP C language library are expected to do their own error checking. .PP The default error handler in \fIXlib\fP (also used by many toolkits) uses standard resources to construct diagnostic messages when errors occur. The defaults for these messages are usually stored in \fI/usr/lib/X11/XErrorDB\fP. If this file is not present, error messages will be rather terse and cryptic. .PP When the X Toolkit Intrinsics encounter errors converting resource strings to the appropriate internal format, no error messages are usually printed. This is convenient when it is desirable to have one set of resources across a variety of displays (e.g. color vs. monochrome, lots of fonts vs. very few, etc.), although it can pose problems for trying to determine why an application might be failing. This behavior can be overridden by the setting the \fIStringConversionsWarning\fP resource. .PP To force the X Toolkit Intrinsics to always print string conversion error messages, the following resource should be placed at the top of the file that gets loaded onto the RESOURCE_MANAGER property using the \fIxrdb\fP program (frequently called \fI.Xresources\fP or \fI.Xres\fP in the user's home directory): .sp .nf *StringConversionWarnings: on .fi .sp To have conversion messages printed for just a particular application, the appropriate instance name can be placed before the asterisk: .sp .nf xterm*StringConversionWarnings: on .fi .SH BUGS If you encounter a \fBrepeatable\fP bug, please contact your site administrator for instructions on how to submit an X Bug Report. .SH "SEE ALSO" .PP XConsortium(1), XStandards(1), appres(1), bdftosnf(1), bitmap(1), imake(1), listres(1), maze(1), mkfontdir(1), muncher(1), oclock(1), puzzle(1), resize(1), showsnf(1), twm(1), xauth(1), xbiff(1), xcalc(1), xclipboard(1), xclock(1), xditview(1), xdm(1), xdpyinfo(1), xedit(1), xev(1), xeyes(1), xfd(1), xfontsel(1), xhost(1), xinit(1), xkill(1), xload(1), xlogo(1), xlsatoms(1), xlsclients(1), xlsfonts(1), xlswins(1), xmag(1), xman(1), xmh(1), xmodmap(1), xpr(1), xprop(1), xrdb(1), xrefresh(1), xset(1), xsetroot(1), xstdcmap(1), xterm(1), xwd(1), xwininfo(1), xwud(1), Xserver(1), Xapollo(1), Xcfbpmax(1), Xhp(1), Xibm(1), XmacII(1), Xmfbpmax(1), Xqdss(1), Xqvss(1), Xsun(1), Xtek(1), kbd_mode(1), todm(1), tox(1), biff(1), init(8), ttys(5), .I "Xlib \- C Language X Interface\fR,\fP" .I "X Toolkit Intrinsics - C Language Interface\fR,\fP" and .I "Using and Specifying X Resources" .SH COPYRIGHT .PP The following copyright and permission notice outlines the rights and restrictions covering most parts of the core distribution of the X Window System from MIT. Other parts have additional or different copyrights and permissions; see the individual source files. .sp Copyright 1984, 1985, 1986, 1987, 1988, and 1989, by the Massachusetts Institute of Technology. .sp Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of MIT not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. MIT makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. .sp This software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California. .SH TRADEMARKS .PP UNIX and OPEN LOOK are trademarks of AT&T. X Window System is a trademark of MIT. .SH AUTHORS .PP A cast of thousands, literally. The X distribution is brought to you by the MIT X Consortium. The staff members at MIT responsible for this release are: Donna Converse (MIT X Consortium), Jim Fulton (MIT X Consortium), Michelle Leger (MIT X Consortium), Keith Packard (MIT X Consortium), Chris Peterson (MIT X Consortium), Bob Scheifler (MIT X Consortium), and Ralph Swick (Digital/MIT Project Athena).