For speed this page has been mirrored locally from
riceinfo.rice.edu. You may find the original
or more up to date versions of this page at original riceinfo site.

1999.5.18
This document helps new account holders familiarize themselves with the X Window System,
Version 11 - simply called X - and maintains an emphasis on concepts and everyday use
rather than highly technical details. This material includes an overview of X concepts
and instructions for starting, conducting, and ending an X session. Also covered are the
Tab Window Manager, or TWM, and the xterm terminal emulator, and other such topics such
as remote processes.
Table of Contents
How to Use This Document
Many books and manuals on the X Window System exist, providing varying degrees of
readability and usefulness. This document attempts to present the X Window System,
Version 11, with an emphasis on concepts and everyday use rather than highly technical
details. Throughout this document the X Window System, Version 11, will be referred to
as "the X Window System" or simply "X."
The structure of this document and its exercises is intended to help you to become
acquainted with X. When beginning to read this document, keep in mind the following
advice: you may find it helpful to read through a section, and then go back and do
the exercises.
Section 1 presents an overview of X and introduces some important terms.
Section 2 covers the basics required to start and end an X session and to use the mouse.
Section 3 explains the Tab Window Manager's (TWM) functions and its menus.
Section 4 gives a brief description of the terminal window, and it lists the various
options available through it. The remainder of this document is not essential to working
with X.
Section 5 discusses the advanced topic of remote processes. You may find it useful if
you wish to display work from more than one computer at a time.
Appendix A lists other sources for more information on X and related software.
Although this document covers X in general, naturally many of the examples will be
specific to the implementations of X on networks maintained by Information Systems
(such as Owlnet and the Rice Advanced Visualization Lab).
Finally, this document includes several references to the UNIX (UNIX is a registered
trademark of AT&T Bell Laboratories) operating system. For more information about
UNIX, see the Information Systems document UNIX 1,
Introduction to the UNIX Operating System.
The X Window System
This section describes X's features and limitations. Some of the details may seem
tedious at first, but understanding the concepts presented here will facilitate
learning
more about X.
Developed at the Massachusetts Institute of Technology in 1984, X provides a
graphics-window system for computer networks. Every computer network requires a system
that will allow users to communicate with it. X provides such a system and employs
graphics windows as its foundation. Each graphics window represents a particular
application, such as a text editor, a debugger, an electronic mail manager, or a
terminal emulator. X lets you open multiple windows and run several applications
simultaneously.
The activity within one window executes independently of the activity in the other
windows. For example, you can compile a FORTRAN program in one window, read electronic
mail in another, run a clock in a third, and run a text editing program in a fourth
window. This feature makes X very powerful because you can access many different
applications---even different computers---from a single terminal; you simply open new
windows as needed.
First, and foremost, however, X is a windowing system, not a complete operating system.
UNIX is an operating system. See the Information Systems document Introduction to the
UNIX Operating System for more information on UNIX. X mediates the communication between
individuals and a computer network. X creates windows that represent applications, but
does not execute the applications itself. In the current Information Systems (IS hereafter
) configuration, applications most often run on the same computer that is serving as an
individual's computer terminal.
You can tailor X to suit your needs. For example, you can tell X to run certain
applications automatically each time you start an X session. That saves you the trouble
of starting them manually every time you log in.
As with most technical environments, X has its own special jargon. You should understand
some basic terms. More detailed definitions of these terms can be found in the references
listed at the end of this document.
As mentioned in the preceding section, applications do not necessarily run on the terminal
where you are working. Your computer terminal is called a display server, and application
s are called clients. The computers which actually execute your clients are called hosts
(they are also known as compute servers).
As an example, the NCD terminals act purely as X display servers. In these
cases, any clients you start are not executing on your computer. X directs your input to
a host and directs output to your display server. On Owlnet, your clients actually
execute on one of the Sun SPARCstations named arcadien, barred, boreal, elf, hawk,
spotted, and so on.
If the term "client" causes confusion, you can substitute
"application" if that makes X concepts easier to understand. Similarly,
"terminal" can be substituted for "display server."
One common stumbling block arises because an X "screen" and "display"
are not equivalent terms. A display corresponds most closely to the video monitor. A
single monitor never has more than one display. It is possible for some displays to
support more than one screen. When this occurs on a single monitor, moving the cursor
past the right or left edge of the monitor will cause the second screen to appear on
that monitor instead of the first. It is also possible to have two monitors serve as
different screens for the same display, in which case moving the cursor off the right
side of one monitor would have it appear on the left side of the other!
For example, one display might use two screens to display a very wide Mercator map of the
world. This could be accomplished using one monitor or two. Some machines have a single
physical video monitor (and a single display) but that display has two screens: a
black-and-white screen and a separate color screen. No IT administered systems currently
have multiple monitors, though many window managers (such as vtwm) support multiple
"virtual screens" on one monitor.
"Window" is probably a familiar term. A window is an enclosed area
(usually a
rectangle) that represents a particular client and displays your interaction with that
client. Title bars and icons are functions of the Window Manager. For different clients,
activity within each window proceeds independently of activity in other windows. Some
clients have multiple windows that interact with each other. With the exception of some
paginators, windows can be moved and resized without affecting the execution of their
clients. Overlapping windows do not affect each other.
One special window is the root window, which forms the background of the display.
Inside the root window you can perform window management functions rather than ordinary
input and output with a window.
Windows can also be represented by icons. Icons are small rectangular symbols
used to
keep many clients from cluttering the screen. Generally, you cannot send input to a client
's icon. First you must de-iconify the icon to convert the icon into a window; then you
may send input to that client. After completing input, you can iconify the window to
convert it into an icon. A client will continue to execute when in its iconic form. For
example, you can open a window, enter the input to run a program, and iconify the window.
At some later time you can de-iconify the icon to view the program's output.
Usually you employ a pointing device like a mouse in X. The section
"Using the Mouse" explains how to use a mouse, graphics tablet, or light pen
to perform most
window operations. These operations include opening windows, selecting text within
windows, moving icons and windows, and viewing menus.
The cursor lets you know where the pointing device is pointing on the screen.
The
cursor may be an arrow, an `X,' or some other symbol. Depending on the pointing device's
target, the mouse buttons may invoke different operations. The cursor symbol usually
changes
to indicate these changing targets. For example, in the body of most windows the cursor
is
an I-beam, on the title bar the cursor is an arrow, and on the root window the default
cursor is an `X.'
To enable window operations, X runs a client called a window manager. The window
manager handles local operations like moving, resizing, and iconifying windows. The
window
manager handles the appearance and manipulation of windows while X supervises
communication between windows, applications, and input/output devices (like the monitor
keyboardl).
The window manager is a special client of the X server. It is the only client with the
ability to move, resize, map, unmap, iconify, and deiconify windows. The window manager
normally has no windows itself, with the exception of the menu windows the user can
summon. It is possible to run an X session without using a window manager, but parts of
windows hidden under other windows would be inaccessible.
Several different window managers exist, and each user can choose his or her own window
manager. However, you can only use one window manager at a time. For example, suppose
there are two window managers available: the Tab and Motif Window Managers. Now when
you
log on, you may use either the Tab or the Motif Window Manager, but not both.
A later section discusses the Tab Window Manager in detail.
Part of customizing X is changing your default window manager behavior to produce a
display that suits your own needs. (See the separate Information Systems Document
Customizing X for information on altering the default X environment and customizing
TWM.)
Other window managers include the "Motif Window Manager" (mwm), the
"OPEN LOOK Window Manager" (olwm), and the Silicon Graphics Window Manager
(4Dwm) used on the SGIs in RAVL and Fondren Library.
Working in an X Session
The X display server is responsible for displaying the information sent to it by X
clients (applications) running on the hosts it is connected to. Sometimes, the same
machine that is running the X server will also be running all of the application
processes as well (this is the case for the Rice UNIX Facility), but more often the
machine that functions as the X server is only responsible for displaying the graphics
output---the applications it displays are run elsewhere (a few machines on Owlnet are
configured this way).
All of the workstations administered on IT start in X Windows. Therefore you only need
to enter your userid and password to begin an X session. When X is ready for you to
begin a session, the display shows a large rectangle centered over a gray background.
The rectangle looks like the figure below.
A blinking vertical line represents the text cursor. The cursor should stand to the
right of the Login: prompt. If not, press RETURN until it does. (The "Login failed,
please try again." message may appear but you can ignore it.) Type your userid,
then
press RETURN. The cursor moves to the Password: prompt. Type your password; it will not
be displayed as you type to prevent other people from learning it. Then press RETURN.
If you have entered a valid userid and corresponding password, the display changes and
brings up a system announcements dialog box. This box displays recent important systems
notices, and it has a HELP button and a GO AWAY button.
If you have entered a valid userid and corresponding password, the display changes
and brings up a system announcements dialog box. This box displays recent
important systems notices, and it has a HELP button and a GO AWAY button.
For help on your system (be it Owlnet, the Rice UNIX Facility, or some other), move the
cursor onto the HELP button, and click a mouse button. Otherwise, click on the GO AWAY
button to make the system announcements box disappear and begin the X session.
If you mistyped your userid or password, the message "Login failed, please try
again." appears. You can enter your userid and password again.
Sometimes you will find a Sun with a completely blank screen, displaying nothing. Three
explanations for this condition exist.
- The screen saver is in effect. Move the mouse or start typing
your userid, and the screen should change to the normal X
startup display. (Note: A blank screen prevents phosphor burn-in.
If a screen displays the same image for an extended period of
time, that image may burn the phosphor coating on the inside of
the monitor and leave a permanent "ghost" image on the
monitor.)
- Someone has locked the screen. If you move the mouse or type,
the following message will appear: "This screen has been
locked by: userid."
- The computer is down. It may have been turned off due
to a power failure, a network upgrade, or system maintenance.
Regardless, Information Systems had a good reason to deactivate
it. Do not try to turn on the computer.
Exercise 1: Try logging in and starting an X session as explained in this
section.
Once you begin a session, you can try the other exercises throughout this document.
Once you have started an X session, a small window labelled "Console (exit me to
quit X)" appears in the upper left-hand corner of the display. Normally you do
not work in the window, but network notices and error messages appear here while you
work. If your terminal freezes or beeps (signalling an error), you may find an
explanation in the window. Observe that the window has a scroll bar so that you can
review messages which have scrolled out of view. Typing exit in this window
will terminate your X session.
Most computer keyboards have special keys in addition to the normal SHIFT key. Two
such keys are the CTRL (or CONTROL) and META keys. The CTRL and META keys perform s
imilarly to the SHIFT key, except that they generate different signals to your computer.
For example, to type `CTRL-C' you hold down the CTRL key and press C. While this action
is analogous to typing `SHIFT-C' to generate a capital C, the computer interprets
`CTRL-C' as an entirely different character than `C.'
Most keyboards have SHIFT and CTRL keys, but the META key may not be obvious. The table
below lists the META key depending on your computer terminal.
TABLE 1: META Key Assignments
Terminal Type Keyboard Key(s)
Sun SPARCstation Diamond (
), ESC, or "Alt"
Silicon Graphics Indigos and Indys Diamond (
), ESC, or "Alt"
IBM XStation "Alt"
Moving the mouse moves the cursor on the display. With most window managers, moving
the cursor into a window's borders shifts the input focus to that window. However,
with some managers (specifically, mwm) the default settings require you to click a
mouse button in the new window in order to shift the input focus to that window. When
the focus has been shifted, the window's border and title bar (if these features are
present in that manager) become highlighted, and if the window contains a text cursor,
the text cursor changes into a solid rectangle. Similarly, placing or clicking the
cursor on an icon activates the icon.
You will observe that the shape of the cursor changes depending upon where the cursor
lies. These shapes indicate that
different functions have become available. The section,
The Tab Window
Manager, explains what the functions do and how to
execute them. Some cursor examples follow; these are the defaults and the user may
change them.
- window body for a text window --- I-beam
- menu listing --- horizontal arrow
- root window --- `X'
- scroll bar --- two-pointed arrow
- title bar --- arrow tilted at 45 degrees
- title bar button --- pointing index finger
Normally the mouse has one or more buttons that initiate different X and TWM functions.
Most mice have three buttons---one each on the left, middle, and right. LEFT, MIDDLE,
and RIGHT refer to the respective mouse buttons.
At some point you may want to select a window or icon. To do so, move the cursor over
the desired symbol, then press and release a mouse button. This action is called
clicking. Specify a window's location or select a range of text.
To move a window, you might also need to click on the window's title bar but
continue to hold down the mouse button. Still holding down the mouse button, you
move the mouse to move or shape
the window. Similarly, click on one end of the text you want, then move the mouse
while holding down the mouse button. The action of moving the mouse while holding down
a mouse button is called dragging.
Read the section, Window Operations
without Menus, for a list of the mouse-selectable operations available.
TWM has two standard menus (see the section,
Standard Menus, for a description of the menus): a function menu and an
application menu. You activate a menu by placing the cursor on the root window and
pressing and holding the appropriate mouse button. A menu appears, and the cursor
becomes a horizontal arrow, indicating that TWM is expecting you to select an item
from the menu.
To select an item, move the cursor (you must hold down the mouse button) onto the menu
and highlight the desired menu item. Releasing the mouse button with the cursor in
place selects the item.
To drop the menu without selecting any item, move the cursor off the menu so that no
menu items are highlighted. Release the mouse button, and the menu vanishes without
selecting an item.
Exercise 2. For some of the next exercises, you will need to open a window
using the text editor of your choice. Move the cursor onto the root window (the
background), and the cursor shows an `X.'
Press and hold RIGHT. A menu titled "Applications" appears, and the
cursor becomes a horizontal arrow. Move the arrow onto the editor you want to use
and it becomes highlighted.
Release the button to finish the menu selection. After a moment, a window frame
appears. Position the window where you want it, then press LEFT or MIDDLE.
Exercise 3. Make another window, but this time suppose you want it to stretch
to the bottom of the display. To do so, follow the same steps as in the previous
window, but at the last step, press RIGHT instead of LEFT or MIDDLE. You have made a
maximum height window.
Terminate one of the editor windows (your choice) by moving the cursor over its
"Quit" button (or box). Click to terminate the window.
Using the mouse, you can copy, paste, and delete segments of text. You can select text
by character, by word, or by line. Notice that as soon as you select text, X
automatically copies it to temporary storage. That is, with X the select and copy
operations are one and the same. Two methods let you make a selection:
Selection of one character, word, or one line (clicking):
- Put the cursor somewhere on the word or line.
- Click LEFT one, two, or three times to select by character, word, or line,
respectively.
Selection of one character, word, or line (dragging):
- Put the cursor at one end of the character, word, or line.
- by character
- Click and hold the LEFT down,
and drag the mouse over the character.
- by word
- Click the LEFT twice, continuing to
hold it down after the second click, and drag the mouse to
select the text word by word.
- by line
- Click the LEFT three times,
continuing to hold it down after the third click, and
drag the mouse to select the text line by line.
Selection of a large area of text quickly, by character, word, or line:
- Put the cursor at one end of the character, word, or line.
- by character
- Click and release the LEFT then put the cursor at the
opposite end of the desired chunk of text. Click the RIGHT once and all characters
between these two points will be selected.
- by word
- Click and release the LEFT two times, then put the cursor
anywhere on the last word of the desired chunk of text. Click the RIGHT once and
all words between these two points, inclusive, will be selected.
- by line
- Click and release the LEFT three times, then put the cursor
anywhere on the last line of the desired chunk of text. Click the RIGHT once and all
lines between these two points, inclusive, will be selected.
Exercise 4. Before you can select text, you must have text to select. Go to your
xterm window and enter (using a capital `X' as indicated):
This command will bring up pages and pages of information about X. After the first
screenful appears, the paginator waits for you to press a key. Type q to
discontinue the output. Now you have some text with which to practice.
Exercise 5. Selecting by Character. Put the cursor at the start of the line
"The X Window System is a..." (near the middle of the xterm). Press and hold
LEFT. Drag the mouse and observe that you can select text one character at a time.
Release LEFT to finish the selection.
Now click LEFT inside the word "Consortium," move the mouse inside the word
"following," and click RIGHT. Notice the new selection of the characters
between the two clicks. Move the mouse again, click RIGHT, and observe how the character
selection changes.
Exercise 6. Selecting by Word. Place the I-beam cursor over the word
"portable," then click LEFT twice. Notice that the word "portable"
becomes highlighted; you have selected a word.
Now put the cursor over "The" in the sentence "The X Window
System..." Click LEFT twice, but continue to hold LEFT down after the second click.
Move the cursor along the rest of the sentence, and observe that you select words as the
cursor moves.
Finally, put the cursor over "developed" and click LEFT twice. Move the cursor
to the word "machines" and click RIGHT to make your selection. Move the cursor
to other parts of the xterm, click RIGHT and watch how the selection changes by word.
Exercise 7. Selecting by Line.
Put the cursor on the line "The X Window System
is a..." and click LEFT three times in rapid succession. You select the entire line
of text.
Move to the line "It should be relatively..." and again click LEFT three times,
but hold LEFT down after the third click. Now slide the mouse up and down, selecting
text by line. Release LEFT after making a selection. Go to the line "X
Consortium..." and click LEFT three times. Now move to the line "X Window
System..." and click RIGHT. Witness the selected lines. Try clicking RIGHT e
lsewhere in the window, and see how the selection of lines changes.
Exercise 8. Practice all three methods of text selection (by character, by
word, and by line). Also practice using just LEFT to select the range, and using LEFT
and RIGHT to select the range.
When you select text, you automatically copy the text into temporary storage,
which you can retrieve for pasting later. Note, however, that you can only retrieve the
most recent selection.
For example, if you select the sentence "Six and nine are fifteen," then
"Six and nine are fifteen" enters temporary storage. If you then select
"How's the weather?" this new selection replaces "Six and nine are
fifteen" in temporary storage. Now if you paste text, you will paste "How's
the weather?"
Because of this feature, you need to be careful not to mistakenly select text. If you
select the sentence "The dog ran quickly," but then accidentally press
the mouse buttons and highlight other text, that other text replaces "The dog ran
quickly" in temporary storage, and you must re-select "The dog ran
quickly."
Once you have copied a selection, you can paste it elsewhere (including a different
window). To paste the selection, move the cursor to the desired insertion point, then
press MIDDLE.
Exercise 9. Copy and Paste. You should have a text editing window open already.
If not, open one from the X Applications Menu. Now, inside the xterm, select the text
between the sections headed "SYNOPSIS" and "DESCRIPTION." Go to the
bottom text-entry area in the window and press MIDDLE. The selected text appears in the
window. You have copied and pasted the text from the xterm to the text editing window.
Copy and Paste Again.Within the window, select the word "relatively."
Place the cursor elsewhere in the text-entry area, and click LEFT once to mark the new
insertion point. Now click MIDDLE and notice where "relatively" is pasted into
the text.
Sometimes you will want to move or remove the selected text rather than copy it. To cut
text, select it and then type CTRL-W. The highlighted text vanishes, but it has also
been copied to temporary storage so that you can paste it if you like. Note, however,
that not all X clients permit cutting.
Exercise 10. Cut and Paste. Inside the editor window, select the line
"UNIX(tm) System V..." Then type CTRL-W to cut the line. Move the
cursor to where you want to paste the line, click LEFT, and then click MIDDLE to paste it.
Now move to the xterm and select the line "Ultrix 3.1 (Digital)." Type CTRL-W,
but notice that the client does not let you cut text. Go back to the window and click
MIDDLE; the line "Ultrix 3.1(Digital)" appears. You copied the line by
selecting it but were unable to cut it. Remember that selecting text automatically
copies it into temporary storage, but not all clients support cutting.
Some functions require that you hold down one or two special keys as you press a mouse
button. Recall that the special keys are the SHIFT, CTRL, and META keys. For example, to
use the SHIFT- combination, hold down the SHIFT key and press the middle mouse button.
Exercise 11. Put the cursor over a window and press RIGHT. You may see X
highlight a text selection, but ignore it.
Press META-RIGHT (while holding down the META key, press and hold RIGHT; you can then
release the META key.) The TWM Window Manager Menu appears. You have just used a special key
(META) with the mouse. Deactivate the menu by not highlighting any of its items, then
releasing the mouse button.
When a window cannot display all the information it contains, a scrollbar lets
you select a region of the information to inspect. The next exercises explain the scrollbar.
Exercise 12. Prepare the Scrollbar. Move to an xterm and enter the following
(using a capital `X'):
Press the spacebar the next few times you see the message:
to let a few pages of text run through the window. Then type q to stop the
printout.
With the mouse on the X window, press CTRL-MIDDLE and select Enable Scrollbar from the VT
Options Menu which will appear. A scrollbar materializes on the left side of the xterm.
Exercise 13. Use the Scrollbar. The scrollbar uses a gray rectangle
(the "thumb") to indicate what part of the information is being displayed. Put
the
cursor over the scrollbar, and the cursor becomes a two-pointed arrow. Click RIGHT a few
times
and notice how the text and thumb scroll backward. Then click LEFT. Now place the
two-pointed
arrow anywhere on the scrollbar and click MIDDLE. Try pressing and holding MIDDLE, then
dragging while holding down MIDDLE. The scroll area slides up and down as you drag the
mouse.
When you finish working on a computer, you log out. The Information Systems X environment
provides two ways to log out. To log out normally, you can:
- Move the cursor into the console window. Enter the command exit and press RETURN. You
should use this method of logging out whenever possible, OR
- Move the cursor into the root window; the cursor should look like an `X'. Press and
hold
the middle mouse button. A menu labelled "TWM Window Manager" will appear, and
the
bottom item will be Exit X-windows. Notice that the cursor becomes a horizontal arrow.
Still
holding the middle button, move the arrow so that you highlight the Exit X-windows item.
Releasing the button will log you out.
You should always try to quit applications you have started during your session before
exiting X, especially editors. This both reduces the chance of processes you have started
continuing to run after you have logged out and also reduces the chance of losing data
(due to unsaved files, etc.). Applications that cannot be easily quit (such as the clock
and
mailbox that come up in the default X session) can be left for the X server to clean up
when it shuts down (or resets).
If these methods do not work, consult the document
UNIX1
Introduction to the UNIX Operating System, speak to a consultant in the
Consulting Center, 103 Mudd Lab, or call 527-4983.
This document does not provide a complete description of every X command, option, or
feature. A group of on-line references provide further detail into these topics, albeit
in a more technical vein. You may want to consult these references, called the manual
pages (or simply "man pages"). While the Information Technology document
Introduction to the Unix Operating System on IT Systems
covers them in greater detail, general methods of reaching the manual pages appear below.
Go to an xterm and enter
where command is the command you want to investigate (such as xcalc, xclock,
etc.). UNIX will search for the appropriate manual pages and let you view them.
Alternatively, you can view formatted (text with italics, boldface, etc.) manual pages
by selecting Manual pages from the X Applications Menu. After a moment, a small dialog
box appears. Click on either of the oval command buttons labelled Manual Page or Help.
Either button brings up a corresponding window. From the Manual Page window, you can
click on the Options display button for a menu. Select Display Directory to see a list
of the available commands. You can then use the scrollbar to view the commands, and
click LEFT on a command you want to investigate.
Exit the formatted manual pages with the Quit button.
Call up the formatted manual pages from an xterm with:
This command is identical to selecting Manual pages from the X Applications Menu.
Exercise 14. Try calling up the regular manual pages. Go to an xterm and enter:
This command tells you more about the manual pages (you are referencing the manual pages
on the man command). Press the spacebar to see the next page of information, press
RETURN to see the next line, or press `q' (the `Q'-key) to stop the printout. If you
like, try entering:
for more information (perhaps more than you want) on X and TWM.
Exercise 15. Call up the formatted manual pages from the X Applications Menu.
Click on Help if you like. When ready to investigate some commands, click on Manual Page.
Browse through the Directory and read about some commands (xterm or maze, for example).
Use the Quit button when you have finished.
The Tab Window Manager (TWM)
As the section,
Window Managers, explains, X may use a window manager, which controls
functions like moving, resizing, and iconifying windows. Several different window
managers exist, but recall that you can use only one window manager at a time.
IT-administered machines use the Tab Window Manager, or TWM, almost
exclusively, and
this section describes TWM in its normal configuration. Hence, this section assumes you
are running X and TWM, and it assumes that you have not customized X or TWM. For
information on customizing X and TWM, see the separate document
Customizing the X
Window System.
TWM's windows are rectangles, and each window has several regions which serve different
functions. Not every window will have all the regions described here.
- Body
- The largest region of the window, the body is usually an area
devoted to text or graphics. Interaction with the client occurs within the body of a
window. Frequently text body will have a small text cursor to indicate where characters
you type will appear.
- Command Button
- An area on the display that executes an operation when
the mouse clicks over it. For example, the system announcements box has HELP and GO
AWAY command buttons.
- Root Window
- The root window forms the background of the display. When
the cursor does not lie within any icon, window, or title bar, the cursor lies within
the root window.
- Scroll Bar
- A scroll bar rests along the left side or bottom edge of a
window. If a window contains more information than the body can display, a scroll bar
lets you select the area to be displayed.
- Title Bar
- Positioned across the top of a window,
the title bar describes the window's client. For example, the
console window has a title bar which reads, Console (exit me to quit X).
- Title Bar Button
- Some small boxes may appear inside the title bar;
these boxes are title bar buttons. Note that title bar buttons are not physical buttons
on the mouse or keyboard. Title bar buttons appear only on the display. Clicking on a
title bar button executes a TWM function associated with it.
To prevent your display from becoming cluttered by many windows, a window can be
converted into an icon. An icon is a small symbol which replaces the window. A
client will continue to run in its icon form, but to send input to that client, you must
convert the icon back to a window. You could run a program inside an xterm, iconify the
xterm and de-iconify the icon later to see the program's output.
TWM displays several different cursor pictures. Some cursors include the root window
`X,' an arrow, and a pointing index finger. Individual X clients may also have different
cursors. For example, the I-beam in an xterm and the up-down arrows when you are in the
scrollbar area are functions of the client, not the window manager.
This section introduces the two standard menus that the default implementation of TWM
provides.
Menus list X and TWM items in an easily accessible manner. You select an item from a
menu as explained
in the section, Menu Item Selection.
Such items include:
- starting commonly-used clients (like text editors and terminal emulators)
- performing window operations (like resizing and moving windows)
- changing window options (like reverse video and font size).
The contents of the standard menus are listed below.
From the TWM Window Manager Menu you can execute many window operations. To
activate this menu,
- place the cursor in the root window (the cursor becomes an `X') and press MIDDLE,
- or
- place the cursor over a different window and use the META-RIGHT combination.
Since many functions operate on windows and icons, the term symbol will refer to a window
or an icon. The functions are described below.
-
Focus
- Directs all input to the selected window, regardless of the cursor
position. You can move the cursor off the window but still type to it.
-
Unfocus
- This resets the input focus back to pointer-driven. The mouse
must be over the window for it to be active.
-
Raise
- Given several overlapped symbols, brings the selected
symbol to the front. With the large dot cursor, you click on the desired symbol.
-
Lower
- The opposite of the raise function.
-
Close
- Terminates the client---represented by a symbol. This is
a relatively clean way to exit a client that doesn't take any keyboard input, such as
the clock, or a graphics window of an application.
-
Kill
- Terminates the client represented by a symbol. This
function provides an inelegant, messy way of exiting a client; first you should try to
terminate the client normally. Usually you execute the Kill window function when a
client freezes and remains unresponsive to any input. See the Information Technology
document
Introduction to the UNIX Operating System on IT Systems for more information on
killing
processes.
-
Resize
- Changes the rectangular area of a symbol. As with the move
function, the cursor becomes a cross-arrow which you place over the desired symbol.
Dragging specifies the new rectangle size, and releasing the button completes the resize
function.
-
Move
- Moves a window or an icon. The cursor becomes a cross-arrow, and
you should place the cursor over the desired symbol. Then by dragging the mouse, you will
move the symbol to the desired location. Releasing the button completes the function.
-
(De)Iconify
- Converts a window into an icon or converts an icon
into a window. The cursor becomes a large dot. First you place the dot over the desired
symbol, then click the mouse to execute the (de)iconify function.
-
Identify
- Displays the source, name, and other properties of a desired window. The cursor becomes
a cross-arrow which you place over the window you want to identify. Clicking once on the
chosen window will bring up a small display showing that window's properties.
-
Refresh
- Redraws the entire display, including all icons and windows.
When many windows are open, TWM may not update the display properly. The refresh
function corrects most display errors.
-
Icon Manager
- Specifies the location settings for your icons.
-
Preferences
- Selects text editors and changes the settings of the bell function and the speed of the
cursor (mouse).
-
Lock screen
- Brings up a blank screen and waits for you to enter your
password before the X session continues. Clients continue running while the screen is
locked. The lock screen function allows you to leave the display server for roughly
twenty minutes; after this time the lock screen program automatically logs you out.
- Restart TWM
- Instructs TWM to read the .twmrc configuration file.
Normally you do not need this option unless you are testing a TWM customization. For
information on customizing TWM, see the Information Technology document
Customizing the X
Window System. Executing it without changing .twmrc will refresh the
display, though much more slowly than executing the refresh function.
-
Kill twm
- Stops TWM. X and its windows continue to operate, but most
window functions (like those in this menu) become unavailable. If you have badly
customized TWM, you may want to stop it with this menu item. It is important that the
console window be open and uncovered when this option is selected, otherwise it will be
extremely difficult to exit the X session!
-
Exit X-windows
- Terminates an X session and logs you out. Normally you
should enter exit from your console instead of this function.
Exercise 1. Try using the Move and Resize functions. Move your xterm so that it
overlaps your mailbox and analog clock (both in the upper-right corner of your display).
Use Bring to front and Send to back on these three clients. Try (De)Iconify on the
analog clock.
The X Applications Menu lets you begin many X clients without having to type lengthy
commands in a window. To call up the X Applications Menu, move the cursor onto the root
window and press RIGHT.
Some applications---such as GNU Emacs, Matlab, or Mosaic---have separate documentation
available. Check the Owlnet Notes or the Consulting Center for Information
Technology documents. The applications are described very briefly below.
- Shell (xterm)
- A window (VT102 or Tektronix 4010). See the section, The
xterm Terminal Emulator, for a complete discussion.
-
Netscape
- A graphically-oriented browser for the World Wide Web.
-
Calculator
- Emulates a hand held calculator. Available in reverse-polar mode using the hp
option.
Text Editors
aXe A simple text editor.
gnuemacs A very powerful freely-available text editor.
pico A very simple text editor with a command help line.
vi An older, terminal-based (non-X) editor.
Mail Readers
elm An interactive screen-oriented mail program.
pine An electronic mail program.
News Readers
tin A line-oriented news reader.
trn A menu-driven news resource; very useful for staying current on
network developments which may affect you.
xrn An X Windows news reader.
Engineering Apps
Matlab A matrix and vector mathematical application.
Maple An interactive symbolic math program.
Mathematica An interactive math, data analysis, and graphics program.
-
Manual pages
- On-line reference manual for network commands, programming languages, and other
network features. The manual pages, or simply "man
pages," are a reference and may not provide adequate help. If you need more help,
visit the Consulting Center or send electronic mail to
consult@rice.edu.
- Owlnet Policy
- A Netscape screen with some notes on Polices for Owlnet
Users.
- Problem
- A Netscape screen with helpful tips on some Owlnet programs.
- Lock screen
- Same as Lock screen from the TWM Window Manager Menu.
Several frequently-used TWM window functions can be executed without activating the TWM
function menu. You execute these functions by moving the cursor to a window region
(body, title bar, etc.) and then pressing the appropriate mouse/special key combination.
TABLE 2: Executing TWM Functions with the Mouse
--------------------------------------------------------------
Cursor Mouse Button
Location LEFT MIDDLE RIGHT
Root Window TWM Window TWM Menu X Appl'n. Menu
Manager
Title Bar Raise Move X Appl'n. Menu
Left Title Bar Iconify Iconify Iconify
Button
Right Title Bar Resize Resize Resize
Button
Icon De-iconify Move ---
--------------------------------------------------------------
Exercise 2. Try some of these menu-free functions. Move your xterm to overlap your
mailbox and analog clock. Then execute the Circle up function a few times by clicking LEFT
with the `X' cursor resting on the root window (the background).
The xterm Terminal Emulator
The xterm terminal emulator is a particularly useful X client. As the name implies, a
terminal emulator emulates, or simulates, a computer terminal display. Many different
types of computer terminals exist, and each handles video information differently. These
many terminals can create severe display incompatibilities because one computer's normal
output may not fit another terminal's display protocol.
To overcome these potential problems, X offers xterm, which is available from the X
Applications Menu. Xterm simulates two widely available industry-standard terminals: the
VT102 and Tektronix 4010 terminals. Normally the VT102 displays text, and the Tektronix
4010 displays graphics. Only one of these modes is active at a time, though both may be
mapped on the screen simultaneously.
The VT102, or VT, window treats its contents as text characters and its body as a terminal
screen. These properties make it suitable for most work. Operations like backspacing,
clearing the screen, and copying text with the mouse function properly. For these reasons,
windows open in VT mode by default.
Because the Tektronix 4010, or Tek, window displays its contents as graphics, its display
behaves differently from the VT window. The Tek window considers everything as a group of
dots to be plotted. Thus, it treats text input and output as dots, not characters, and
normal text operations do not function normally.
Backspacing does not erase characters on the screen (although the computer processes the
backspace properly), and characters typed over one another simply print on top of each
other, creating a messy jumble. Changing font size does not resize the window (as occurs
with the VT window), but subsequent characters appear in the new size. Normal
screen-clearing commands do not work, and you cannot select text with the mouse.
Tek mode may be used with programs like Matlab to plot graphics, though most such programs
can work directly with X instead.
Though powerful, xterm in VT102 mode is only a medium for the display of text output; it
does not execute commands itself. Instead, xterm calls a shell, which is a program that
does all the communication between the xterm and the operating system. It is the shell that
makes a true terminal emulator---each shell is a separate command environment. When the
shell is exited, xterm also exits. There are many shell varieties; the most popular are
the C shell and the Bourne shell. On IT-administered machines, the C shell is exclusively
the default. More information is available on shells in the Information Technology
document,
Introduction to the UNIX Operating System on IT Systems.
Four different xterm menus let you modify various characteristics of an xterm window.
These characteristics include font size, scrollbars, and reverse video (white-on-black).
To call up the appropriate menu, use the following table.
TABLE 3: Calling Up Xterm Window Menus
--------------------------------------------------
xterm Menu Mouse Cursor Location
--------------------------------------------------
Main Options CTRL-LEFT Over a VT or Tek window
VT Options CTRL-MIDDLE Over a VT window
VT Fonts CTRL-RIGHT Over a VT window
Tek Options CTRL-MIDDLE Over a Tek window
--------------------------------------------------
You can activate this menu from either a VT or a Tek window, but normally you will not
need to use any of the options.
TABLE 4: Main Options Menu
---------------------------------------------------------------------
Menu Item Action
---------------------------------------------------------------------
Secure keyboard All keystrokes are sent to this xterm.
Allow SendEvents Allows events to be sent to an xterm.
Log to File Logs all input and output in the window to a file.
Redraw Window Redraws the window contents.
Send STOP Signal Suspends the current process.
Send CONT Signal Continues a stopped process.
Send INT Signal Interrupts a process.
Send HUP Signal Hangs up the process and kills the xterm.
Send TERM Signal Teminates the process without killing the xterm.
Send KILL Signal Kills xterm and all processes running in xterm.
Quit Kills the xterm.
---------------------------------------------------------------------
Available if a VT window is displayed, this menu contains three sections, separated by a
horizontal line. The upper section lists the available VT display options. The middle
section offers two window reset commands, and the lower section activates the Tek window.
From the upper section you can toggle (turn on or off) many window characteristics. If an
option is in effect, a check mark appears next to it. You toggle an option by highlighting
it with the mouse and releasing the mouse button (just like normal menu item selection).
The different options are listed below, with explanations as appropriate.
TABLE 5: VT Options Menu (Continued)
------------------------------------------------------------------
Menu Item Action
------------------------------------------------------------------
Enable Scrollbar Turns on the scrollbar.
Enable Jump Scroll Makes the window move text several
lines at a time instead of one
line at a time.
Enable Reverse Video Reverses the current foreground and
background colors.
Enable Auto Wraparound Wraps text which would run off the
right margin onto the next line.
Enable Auto Linefeed Adds a linefeed character after a
carriage-return (RETURN) character.
UNIX terminals do not need this
toggle.
Enable Application Cursor Activates cursor keys, but they may
Keys not perform as expected if an
application does not use them.
Enable Application Keypad Activates keypad, but it may not
perform as expected if an application
has not been programmed to use them.
Scroll to Bottom on Key Makes the window jump to the bottom
Press when you type.
Scroll to Bottom on tty Makes the window jump to the bottom
Output when new output appears.
Allow 80/132 Column Permits some applications to switch
Switching between 80 and 132 character width.
Enable Cursor Emulation Corrects a VT bug that only affects
some applications. You probably
do not need this option.
Enable Visual Bell Flashes the window once instead of
sounding your terminal bell (beep).
Enable Margin Bell Sounds bell (beeps) when typed input
approaches the right margin (like
a typewriter).
Show Alternate Screen Indicates if you are looking at an
alternate screen. You cannot toggle
it yourself.
Do Soft Reset Corrects scrolling if a program failed
to reset it properly.
Do Full Reset Clears VT window, and returns VT Options
to their original settings.
Reset and Clear Saved Lines Clears lines saved in the scroll buffer
and resets the scrollbar thumb.
Show Tek Window Makes the Tek window visible.
Switch to Tek Mode Makes the Tek window active (input and
output now occur in the Tek window,
not the VT window).
Hide VT Window Makes the VT window vanish, automatically
switches to the Tek window and Tek mode.
-----------------------------------------------------------------
Exercise 1. Go to your xterm and activate the VT Options menu with CTRL-MIDDLE.
Toggle the Enable Scrollbar Option. Then toggle the Enable Reverse Video Option. If you
like, toggle them back (off).
A VT window must be displayed before you can select the font size. Most options are
self-explanatory, although the Default font makes the font return to the size specified
when the window opened. Changing the font size changes the window size because the VT
window alters its size to fit the font.
TABLE 6: VT Fonts Menu
------------------------------------------------------
Menu Item Action
------------------------------------------------------
Default Selects the starting xterm font size
Unreadable Selects VT font size
Tiny Selects VT font size
Small Selects VT font size
Medium Selects VT font size
Large Selects VT font size
Huge Selects VT font size
Selection Changes to the desired font for a chosen window.
------------------------------------------------------
Exercise 2.
Call up the VT Fonts menu with CTRL-RIGHT. Select the font Small. Then select Large,
then
Tiny, and finally Default. Notice that each time you change fonts, the window size
changes,
and the window is redrawn.
The Tek Options menu only appears if you have a Tek window open. The menu contains three
sections: font size, window commands, and Tek/VT selection.
TABLE 7: Tek Options Menu
-------------------------------------------------------------------
Menu Item Action
-------------------------------------------------------------------
Large Characters Selects Tek font size.
#2 Size Characters Selects Tek font size.
#3 Size Characters Selects Tek font size.
Small Characters Selects Tek font size.
PAGE Clears Tek Window.
RESET Clears Tek Window.
COPY Disabled. (Normally it writes a file of the
Tek commands you have issued.)
Show VT Window Makes the VT window visible.
Switch to VT Mode Makes the VT window active (input and output
now occur in the VT window, not the Tek
window).
Hide Tek Window Makes the Tek window vanish, automatically
switches to the VT window and VT mode.
-------------------------------------------------------------------
Remote Processes (Clients)
Recall that clients do not have to run on the same computer as your display server. Such
clients are often called remote processes. Normally when you log in, X displays
your
windows on your terminal with no difficulty. In some cases, however, you need to tell X
where
it should display information.
This section explains how to tell X your display destination. UNIX maintains a group of
system
variables called the environment. A simplified explanation is that your
environment
includes
items like your userid, your host computer, and other information that UNIX needs to
coordinate
your activities.
One environment variable, DISPLAY, indicates to clients where to connect to your X
server. X
looks for DISPLAY so it can direct graphics to you.
Each DISPLAY variable has the following form:
hostserver: display number. screen number
Hostserver is the name of your display server, and it usually has the suffix
.rice.edu.
Display number refers to all the monitors that share a common keyboard and
pointer (usually a mouse). On machines administered by IS, workstations almost always
have only
one keyboard, and therefore have only one display. The display number is zero
(0) in
this case. Screen number distinguishes one screen buffer from another for the X
server.
This could happen with two separate monitors or with only one. Some display servers have
hardware that supports two screens on a single monitor.
For example, consider a display server with multiple screens named tuna. An xterm
displayed on the monochrome screen could have a DISPLAY of
tuna.owlnet.rice.edu:0.1.
A different xterm which resides on the color screen, could have
a DISPLAY of tuna.owlnet.rice.edu:0.0.
On machines with only one screen it is possible to omit the screen number in the
DISPLAY environment variable. In that case, the screen number is assumed to be zero.
Exercise 3. Go to your console and enter:
If you are already at the display server wahoo, you will see:
wahoo.owlnet.rice.edu:0.0
That is your DISPLAY environment variable, which tells X where to send output for your
console.
Every time you open a new xterm window, you create another shell (see the section,
The Shell in xterm) and thus create a new command environment.
Each of
these environments contains its own
separate set of environment variables; changing one environment does not affect
the other ones.
When a new xterm is created, it inherits these environment variables from the shell under
which
the command to create it was executed. These variables are set and used by the operating
system, programs, and the X server. More information is available on this topic in the
document
Introduction to the UNIX Operating System on IT Systems.
Exercise 4. Go to your console and enter:
Then enter the same command inside your xterm. You should see identical DISPLAY values.
Note
the server (including the .rice.edu). Now, still in your xterm, enter:
setenv DISPLAY server:1.2
Remember that you substitute your display's name (i.e. wahoo.owlnet.rice.edu) for server.
Again
enter printenv DISPLAY in the console and the xterm. Notice that the DISPLAY values
differ now.
To complete the exercise, reset the altered xterm's DISPLAY by entering:
setenv DISPLAY server:0.0
You will likely use the UNIX command rlogin, which stands for
"remote login."
With
rlogin you can login to accounts you have on other computers.
For example, suppose you have a project that requires a special computer which is not
included
on the same network as the computer account you are currently logged in to. First you
obtain an
account from the administrators of this computer (usually by filling out some forms).
Rather than travelling to the special computer's physical location, you can rlogin from
an IS terminal.
Exercise 5. Enter an xterm and type:
The window will return hostname, the name of your current host (wahoo, for
example.) Now
enter
(rlogin ural, for example if you're on Owlnet). The xterm should display the
greeting
text that you see when you first login. You have just conducted a remote login.
When you rlogin from an xterm, UNIX creates a new environment inside the xterm's
existing
environment. However, this new environment lacks the DISPLAY variable. The absence of
DISPLAY
within the new environment occurs because the new environment is created purely by the
UNIX
system and without X's input.
Exercise 6. Inside the xterm, enter:
The window should return nothing except a new UNIX prompt. This new environment does not
have a
DISPLAY value, so it prints nothing.
For most work inside the xterm you will not encounter problems. You can still perform
operations
like moving between directories, copying files, using the vi text editor, and compiling
and
running most programs.
However, any commands that start a new X client will fail. UNIX starts the new client,
but X
does not know where to send the graphics, so the client fails and terminates. This mishap
occurs because does not exist.
Exercise 7. Still in the current xterm, enter:
puzzle &
Nothing happens, except that you receive an error message like the one below.
puzzle: unable to open display
[1] Exit 1 puzzle
Because the new environment created by your rlogin has no DISPLAY, X does not know where
to
send the puzzle graphics. Now, go to your console and enter:
puzzle &
This time you should get a little pocket-puzzle window. Since your console has a DISPLAY
value,
X can open a window for the puzzle.
To correct this missing DISPLAY problem, you can specify a display when you start a
client, or
you can add DISPLAY to the environment. The following exercises show you how.
But first, delete the puzzle (use the TWM Menu item "Close").
Exercise 8.Go to your console and enter:
printenv DISPLAY
If you are working at wahoo, your-DISPLAY-value is
wahoo.rice.edu:0.0.
To make the puzzle appear normally, you need to specify DISPLAY when you start a client.
Exercise 9.
Return to the rlogin-ed xterm and enter:
puzzle -display your-DISPLAY-value &
The puzzle should appear normally.
In Exercise 9, you indicate DISPLAY by using the -display your-DISPLAY-value
option. Since you normally use one display server, you may not want to type the
-display your-DISPLAY-value
every time you start a client. Instead you can use the
setenv DISPLAY your-DISPLAY-value
command, as in Exercise 10, to put your dispay server into the new environment.
Exercise 10. Delete the puzzle again. In the rlogin-ed xterm, enter
setenv DISPLAY your-DISPLAY-value
By doing so you add DISPLAY to the new environment. Now start a puzzle by entering:
puzzle &
Start another puzzle with the same command.
Exercise 11. To end this group of exercises, delete the puzzles. Then go to the
rlogin-ed xterm and enter:
exit
Notice that the xterm window does not disappear because you only exited the rlogin-ed
shell, not the xterm's inherent shell.
Besides using DISPLAY to direct graphics, X has a command which lets you specify which
computers can and cannot display graphics on your display server. The xhost command
limits access to your display.
xhost maintains a list of allowed hosts. Adding or removing hosts from the list
determines display access. However, your changes only affect subsequent display attempts.
If a host is displaying a window and you then remove that host from the list, the window
continues to operate normally, but the host cannot create any new windows. In other words,
changing xhost does not affect existing windows, but it does affect subsequent ones.
To see this list, enter:
A message indicating whether access control is enabled appears, followed by a list of
hosts. Note that your initial host (the computer to which you logged in) does not appear
on this list.
Usually, you only want to permit your host computer or computers to affect your display.
To prevent a host from displaying information on your display, enter
To enable a host to display information, enter
For More Information
Hopefully this document has helped you become familiar and comfortable with X. For more
information about X, consult the Consulting Center or the following sources.
- X Window System User's Guide for Version 11, Volume Three by Tim
O'Reilly, Valerie Quercia, Linda Lamb.
- The manual page entry on X.
- The Computer Reference Area (CRA), located in room B40 in the basement of Fondren Library, has a wide selection of helpful books about how to use the X Window System.
There are also many news groups that concern X, the most notable being:
- comp.windows.x
- comp.windows.x.motif
- comp.windows.x.announce
- comp.windows.open-look
Many of these groups have a monthly listing of frequently asked questions (FAQ) that are
quite helpful to the new and experienced X user alike.
If you still have questions or problems, you can ask for help at the
Consulting Center in 103 Mudd Lab. You can also contact them at
713-527-4983 or send email to problem@rice.edu. You can also submit
a problem at http://problem.rice.edu.
Back to Information Technology
User Services Publications Team
(pubteam@rice.edu) 1999.5.18.