[Univ of Cambridge] [Dept of Engineering]

X windows

X windows is a network graphics system. The X server is the program that handles the mouse and keyboard input and controls the screen. The Xserver accepts requests from client programs such as xclock which may be running on any machine in the network. Clients usually look at the user's DISPLAY environmental variable to see which server to send its requests to. Use
   echo $DISPLAY 
to see how you are set up. You can change the DISPLAY if you want by typing "export DISPLAY=new display"

This client-server model gives greater flexibility but makes the server a complex piece of software. It accepts requests (in a protocol language common across machine types) from various clients `simultaneously', rebundles theses requests for effeciency, then executes them. It also handles resources like fonts on behalf of the clients so that clients can share them. The present X windows, X11, is into its 6th public domain release. HP's version is a variant of release 5. Libraries of higher level functions exist too, and are on the way to being standardised.

In /usr/bin/X11 there are various clients (xclock, etc).

In /usr/lib/X11/fonts is a directory of fonts.

In /usr/lib/X11/rgb.txt there is a list of colors.

When a client starts, the fonts, colors etc that it uses can be set up in various ways. These, in the usual order of precedence, are

  1. Command line arguments
          hpterm -fn 6x10 -bg "Blue"
    
    will give you a terminal window with cute little text on a blue background.

  2. .Xdefaults in your home directory

    See an application's online documentation for details or better still look at someone else's file. Here are 2 sample lines :-

               HPterm*foreground:		Yellow
               HPterm.scrollBar.foreground:	Brown
    
    These lines specify foreground colors in an hpterm window. The `.' seperates fields of a resource's name; the `*' is a wildcard representing any number of fields in a name. The first line sets the foreground colors for text, the scrollbar etc to Yellow. The 2nd line, which overwrites the action of the 1st, sets the scrollbar color to Brown. The Using X document gives more details.
  3. System setup files : ordinary users can't change these.

  4. Defaults within the application itself

A special application is the window manager which is what you use to move windows around. See the appropriate manual page for details. The window manager we use by default is fvwm2.

Writing Your own applications

See HP manuals, the O'Reilly & Associates manuals (on sale in some bookshops, or the X11 Concise guide.
[Graphics] [Help]
Updated 26th January, 1998.
tpl@eng.cam.ac.uk