© 2008 by the Rector and Visitors of the University of Virginia.

The information contained on the University of Virginia’s Department of Information Technology and Communication (ITC) website is provided as a public service with the understanding that ITC makes no representations or warranties, either expressed or implied, concerning the accuracy, completeness, reliability or suitability of the information, including warrantees of title, non-infringement of copyright or patent rights of others. These pages are expected to represent the University of Virginia community and the State of Virginia in a professional manner in accordance with the University of Virginia’s Computing Policies.

ITCWeb: u014.xwindows

U-014, INTRODUCTION TO THE X WINDOW SYSTEM


INTRODUCTION

The X Window System was developed by researchers at the Massachusetts Institute of Technology in cooperation with several computer workstation vendors to provide a windowing tool that would be portable across different computer and display architectures, and across different operating systems. It is operating-system neutral, supports a variety of hardware implementations, and is capable of displaying on ``remote'' devices across a network. This document will focus on the X Window System user interface supported by the Information Technology and Communication (ITC) workstations. The X Window System may be referred to as "X Windows" or "X" in the text. The designation X came naturally since its predecessor was called W (much as the C programming language followed one called B). The current release publicly available from the X consortium is X11R6. As of the summer of 1994, this release was still insufficiently stable, and much software remained to be developed for Release 6. Therefore, ITC still supports Release 5.

The first major section, "Accessing the X Window System," gives instructions on how to access X Windows. The second section, "Using the X Window System," explains the concepts of window systems and the workstation as a multi-user environment. The section entitled, " Window and Mouse Basics," covers the rudimentary tasks of interaction with the windowing system in detail. The section on "Applications" focuses on several of the more popular programs.

This document is designed for the beginning X Window System user. A good working knowledge of Unix commands is recommended, as well as familiarity with one of the editors available on the Unix platforms. The following documents are available from ITC in the hallway outside the Help Desk in Wilson Rm. 235 (free of charge) or from the Universi- ty Bookstore if there is a charge as indicated by ($):




        U-002     "Introduction to the Unix Operating System"

        U-003     "JOVE Text Editor on the RS/6000 or Sun Computer"

        U-003A    "JOVE Reference Manual" ($)

        U-004     "Vi for Unix Systems" ($)



ACCESSING THE X WINDOW SYSTEM


Using eXceed

The X Window System "server" program called eXceed is installed on the PCs in Gilmer 109 and the Catlin Stacks (Thornton A233). This program allows PCs to run X Window "client" applications from Unix machines on Grounds. ITC has a license to distribute eXceed to some members of the university community under certain conditions. Call the ITC Help Desk at 924-3731 to find out the current distribution policy. To run eXceed, find the application icon labeled "eXceed4" and double click on it. Once eXceed has started up, you should get an "XDMCP Menu." From that menu, choose the machine on which you have an account. You will be presented with a loginID and password dialog box. Enter the appropriate information and press the Return key. You will then be logged into your account and the ITC default X configuration will come up. For more information on customizing your X Windows environment, see the document U-014A, "More About X Windows."

Using MacX

MacX, the X "server" software for the Macintosh, is available in the public Macintosh labs, as well as on the dorm servers. Unfortunately tunately, there is no way to get the same XDMCP menu using MacX. To run MacX as a regular server, there are a number of steps you must take.


   o  Locate the "MacX" application icon on the server.  It shows  the  X

      icon  on  a  tray  carried by a waiter's hand.  It should be in the

      same folder as four other icons including MacX Colors and a  folder

      called MacX Fonts.



   o  If you are running from your own machine, you may want to copy  all

      of these files down to your Mac for quicker access.



   o  Double-click on the MacX icon.  An opening dialog box  will  appear

      and show memory usage while the program loads.



   o  You may get a dialog box saying The `Font Directory' File (in  your

      `MacX  Fonts'  folder)  needs to be updated, but an error (-45) oc-

      curred when it was being written.  This is because you are  running

      it from the server, but should not present a problem.  Click on the

      button labeled OK to continue.



   o  From the Edit menu, select "Display Preferences...".   Choose  the

      radio button labeled "Rooted" and click OK.  It will present a dia-

      log box to which you should again click OK.



   o  From the Remote menu, select "New Command...". Enter the command:



         /X11.5/bin/startx -display "@display"; /X11.5/bin/tvtwm -display "®display"

         (or mwm or twm depending on the window manager you run -

         see your .xinitrc.ksh file.)



      (Note: The ® character is generated by holding down the  option  key

      and pressing r.)



   o  Fill in StartX for the Command Name. Fill in your userID  where  it

      says  Username:  and  your  password where it says Password: - then

      click on the button labeled Host...  It will bring up another  win-

      dow.   Type  in the full name of the machine on which you have your

      account.  For example, you might type in  blue.unix.virginia.edu

      and then click OK.



   o  Click on the button labeled Set.



   o  You must now save this document and re-open it.  Select "Save" from

      the  File  menu and select a place to save the file.  Note that you

      cannot save it on the server, but must save it on a floppy disk  if

      you  are  in  a public lab.  Saving onto a disk that you can access

      later will keep you from having to go through this  entire  process

      again.   Now, under the File menu select "Close TheNameYouSavedAs."

      Then select "Open" from the File menu.  Use the standard  find-file

      dialog box to locate the file that you just closed and select Open.



   o  Choose "Edit Command..." from the Remote menu.  Select  StartX  and

      click  the Edit... button.  From the pop-up menu labeled Display...

      choose (0) Color Rooted. Again click Set, and  then  choose  "Save"

      from the File menu.



   o  From the Remote menu, choose "StartX".  You will be  prompted  for

      your password.  Type it and click OK.



        You should now see the default ITC X Window System interface.

Two possible problem sources: 1) a incompatibility in the naming of colors in the X window system and the Mac and 2) font definitions. However, neither problem should prevent your session from running. Also note that you will not enter your RS-6000 account at /home/userid. You can easily change directories to /home/userid by typing "cd" at the Unix prompt. You may also have to change the key mapping of your backspace key. First test your backspace key and if it is not working properly enter "stty erase ^?" at the Unix prompt. If you plan to use MacX often you may wish to modify your .kshrc file to include the line: alias mac='cd; stty erase ^?'.

For more information on customizing your X Windows environment, see the document U-014A, "More About X Windows."

Using an X terminal

Every X terminal should automatically be displaying the XDMCP menu. Select a machine on which you have an account and click on the "accept" button (or press the Return key). You will then be prompted for your loginID and password. Fill them in and then press the Return key. You will then be logged into your account and the default X configuration will appear. For more information on customizing your X Windows environment, see the document U-014A, "More About X Windows."

Using a workstation

If you are sitting at a workstation console, the workstation name will be displayed followed by "login:" in lower case. Type in your loginID and press the Return key. You will then be prompted for your password. Type your password and press the Return key. If you mistype your password, you will need to re-enter your username and your password, not just your password. When you get a Unix prompt, type startx and press the Return key. You will then be in the X Window System with the default ITC configuration. For more information on customizing your X windows environment, see the document U-014A, "More About X Windows."


USING THE X WINDOW SYSTEM

The Workstation Environment

In the Unix labs, you may be using either a Sun IPC, a Sun Ultra, an SGI, or an X terminal, such as an IBM X-Station. While there are currently no publicly available RS/6000 monitors or X terminals, they can be found in many departmental labs. The Sun Ultras, the SGIs, and the RS/6000s are stand-alone computers or "workstations" with graphics monitors. You must log in and then give the command to begin an X Windows session. When you are finished, you must shut down the window environment AND then log out from the workstation.

Throughout this document, we must often distinguish between the way things are set up or behave on a stand-alone workstation as opposed to an X terminal. X terminals have a similar appearance to the workstations, but they are dependent on SPARCstations or RS/6000 workstations to run the X client software. An X terminal is really just a display device. It cannot do any computational work. It can merely communicate with other computers, giving them keyboard and mouse responses.

If you are using an X terminal, the X Windows environment will appear automatically when you log in; you do not need to give a command to cause this to occur. When you exit the window environment on an X terminal, your login session terminates, and the terminal is ready for a new user as indicated by the XDMCP list of machines appears.

It is important that you realize you may not be the only user who is logged into a workstation. Other users may have remotely connected to the machine over the network and may be using software that is only available on that particular workstation. For this reason, you are NEVER to turn off the machine, even if it does not appear to be working properly. Some guidelines are given in the section "Where To Get Help" at the end of this document if your machine becomes inaccessible. Help is available from the consultant in Small 102 or Thornton E225 or from the ITC Help Desk at 924-3731.

Client and Server Model

When reading about X Windows in the literature or on the USENET News, you often see the terms "client" and "server" applied to the X programs and display devices. Such references can be confusing at first, but a little consideration of the circumstances may help to clarify these terms.

What is necessary for an X application to run is a CPU and usually some disk space. What is necessary for display and interaction are a bitmapped display, a keyboard, and mouse. Typically, a user will be seated in front of and logged into a workstation or X terminal that is running X with a window manager. The user will then open a session on a remote machine, and run an X application there, with the CPU of the remote machine doing the work required by the program. The remote machine becomes an X client that makes requests of the user's local workstation (display device), the X server.

The client X program communicates with the X server and tells it to write on the display and read input from the keyboard and mouse. The X server writes on the display and reads the keyboard and mouse. You can run X client programs on your workstation or on remote machines. When run remotely, the X client programs communicate over the network with the X server running on your workstation. Please refer to the following section for instructions on setting the DISPLAY variable and xhost command if you will be running an X client program on a remote computer.

If you are using an X terminal, it only has the capacity to act as an X server. Programs that appear to be running on an X terminal are actually running on another machine.

The ability to run on several machines but display on the X server is a useful capability of the X Window System. Using this facility, an individual can use X-based graphics software which is not available on his workstation, yet see the results in a window controlled by the remote machine. The remote host is doing all the work and is therefore not a drain on the computing power of the workstation.

Setting the DISPLAY

If you are running an application which resides on your workstation, there is no need to specify the display device. If you are running software that resides on a machine other than your workstation, you must tell the client (running on the other computer) the address of the server machine (your workstation). This is a two-step process and can be accomplished as follows:




     Assume you are logged in  on  "my_machine.unixlab.virginia.edu,"

     and  you  intend  to  run  a  program  called  x_application  on

     "remote.dept.virginia.edu" displaying on "my_machine".



      1.   Allow the remote machine to display on your screen by

           issuing the command:



                     xhost +remote.dept.virginia.edu<CR>



           on your workstation.  This step is not  necessary  if  you

           are logged in on an X terminal, since it is already set to

           display from any host machine that requests its services.





      2.   rlogin to the other machine by issuing the following  com-

           mand in one of your workstation's windows:



                     rlogin remote.dept.virginia.edu<CR>



           and complete the login process by giving your password.



      3.   Type these commands on the remote machine to tell it where

           to display:



                     DISPLAY = my_machine.unixlab.virginia.edu:0.0<CR>



           (Note: If you are running csh or tcsh instead of ksh, the

           previous two lines will not work.  Throughout this document

           it is assumed you will be using ksh as your default shell.)



      4.   Run the application from the remote machine by giving  the

           command  x_application  &, which may cause a window to ap-

           pear on your current workstation  through  which  you  can

           communicate with the client program.

Startup Files

The startup files mentioned in this document are the default startup files when a user is issued a Unixlab account. The current version of these files is in /help/unix/account.customize/startupfiles. If you are not a new user, you may want to refer to these files. They have been designed to serve as instructional devices as well as functional files. If you decide that you want to install the latest startup files into your account, issue the command install.startup. If you only want the latest files relating to the X Window System, issue the command install.startup -x. See the man page for install.startup for more in- formation. The structures in the files that are pertinent to the X Windows environment and the syntax of the commands are explained in detail in document U-014A, "More About X Windows."

Your .profile, .variables.ksh and .kshrc files are read when you log in and use the default "ksh" shell. If you are on an X terminal, the .xinitrc.ksh file is read instead of the .profile file. Further information on these two files is contained in U-002, "Introduction to the Unix Operating System." When you begin an X Window System session, there are four additional X startup files that are read.

The first is named .xinitrc, where your default shell is checked and the next startup file run. The next file, named .xinitrc.ksh, is where the initial preferences, programs (clients), and window manager are specified. The last command in this file, causes the startup file for the window manager to be read next. If you are using the Tab Window Manager (TWM) the last command in the .xinitrc.ksh file will be exec twm. All references in this document assume the window manager is TWM. Other window managers are discussed in U-014A, "More About X Windows." If you are using an X terminal, the .xinitrc is the first file to be read.

The name of the third X startup file will vary depending on which window manager was invoked in the .xinitrc.ksh file. Since we assume that you are running TWM, the third X startup file's name is .twmrc. This window manager startup file governs the appearance and behavior of the user interface by specifying variables, bindings for mouse buttons and keys, and menus.

The fourth X startup file, .Xresources has been defined in the .xinitrc.ksh file as the place to specify user resources. The .Xresources file sets client-specific attributes. These include such things as a window's appearance, screen location, color, font, and behavior.

Entering and Leaving X Windows

If you are not using an X terminal, you must type the command startx, followed by a carriage return. For example, if user mst3k has logged in to sunipc-3,

sunipc-3: /home/mst3k $ startx <CR>

A screen similar to Figure 1 on will eventually appear, although it may take a minute or two.

If you have logged in on an X terminal, the X session will begin automatically, since an X terminal reads your .xinitrc file first.

To leave the windowing environment, you must use the option "EXIT Window Manager" accessed from the root, or background, area of the screen. Bring up this menu by moving the mouse pointer into the root area, and then press and hold the left mouse button (Button1). After the menu appears, drag the mouse (still holding Button1) until the "EXIT Window Manager" item is highlighted. Then release the button. This tells the window manager to stop running, and it will also kill off any processes that may have been running in other windows. For more discussion of the mouse, menus, and screen areas, please refer to the section "Window and Mouse Basics" below. If you are using an X terminal, exiting the windowing environment will also log you out.

If you are using a stand-alone SPARCstation or other workstation, you must exit the window manager using the menu and, in addition, give the command exit at the system prompt in order to log out. For example, user mst3k on sunipc:

sunipc-3: /home/mst3k $ exit <CR>

Make sure the machine is showing a "login" prompt before you leave the workstation.

Startup Screen for the X Window System

Figure 1. Startup Screen for the X Window System


   o    Root Window: the stippled gray background area of the screen.



   o    Visible Windows: the  window  with  title  "BigWindow"  has  been

        created in an "open" state using an xterm command in the .xinitrc

        file.



   o    Titlebar: the strip across the top of the window showing the name

        of the window, a close box (left) and a resize box (right).



   o    TWM Icon Manager: an organized list of windows and utilities that

        are not represented by icons.



   o    Hidden Windows: the window whose icon title is  "little,"  above,

        is  in  a  closed  state.  A "CONSOLE" window will be listed on a

        workstation screen.



   o    Tools and utilities: the clock and mailbox.



   o    Isolated Icons: the mailbox is a picture that stands for  a  pro-

        cess, in this case, the command xbiff.



   o    Menus: the buttons on the mouse, when pressed and held in certain

        screen  locations,  will  display menus from which you can select

        tasks.  Menus can be accessed through the root window or  through

        the titlebar at the top of a window.


WINDOW AND MOUSE BASICS

The figures in this section were obtained while using the Tab Window Manager (TWM). You can refer to Figure 1 to identify some of the objects mentioned below.

Console

If you are logged in to a workstation, you will see a CONSOLE window in the Icon Manager list. Do not remove the console window. It represents your original login session, prior to the X Window System being invoked. We have invoked this window in a "closed" mode in the initialization file. It will be indicated by the symbol x next to its name in the Icon Manager. The window's primary purpose is to keep system messages from broadcasting across the entire workstation screen.

X terminals cannot have a console window, since they just provide a "viewport" into the machine that hosts them. On an X terminal, system messages are not directed to the screen, but appear on the console of the host machine.

Mouse

The mouse allows you to move the focus of input around the screen. On a workstation, the mouse has three buttons. They are referred to as Button1, Button2, and Button3, from left to right, respectively. The Sun's mouse is an "optical" mouse meaning that it uses light instead of a mechanical ball to determine its location. Optical mice must use special tablets with grids in order to show movement on the screen. This tablet should be oriented with the longest side along the bottom. The mouse sits on the tablet so that the three buttons sit comfortably under your fingers.

Not every computer that acts as an X server has a three-button mouse. For users of eXceed that only have a two-button mouse, the left button is button one, the right button is button three, and button two is simulated by pressing both buttons at the same time. For Macintosh users, the one button on the mouse acts as button one, the left arrow on the keyboard acts as button two, and the right arrow on the keyboard acts as button three.

There are several mouse pointer symbols that are listed in the following chart. Each has a specific area in which it appears, and there is often an associated action.

Pointer SymbolAppears in:Function or Effect
Indicator of location Root areaIndicator of location.
I-beam Window's text areaTracks active window and is used to "copy" text from a region.
Black Box Window's text areaIdentifies location where keyboard input will appear or mouse click will apply.
Selector Titlebar region or is
used by an application
Accesses window menu or is used to make a selection in an application.
Points to menu item MenuPoints to menu item.
Scrolling Scrollbar regionEnables mouse clicks to move up or down through the text in the window.
Resize and close Titlebar BoxesPointer to the Resize and Close buttons.
Four-headed arrow Resize buttonRequests movement of mouse up, down, left or right to change the size of the window.
Watch Any applicationWork is being done.Wait patiently.

The preceding chart provides a list of the more common symbols. The symbol changes depending on the location of the mouse pointer and on the activity being performed. The bold x appears if the mouse pointer is in the root area of the screen. If the mouse is moved into a window's text area, the pointer changes to an I-beam (I). In X Windows, the I-beam lets you know the xterm window is active and ready to accept keyboard input or mouse activity. Note: you cannot type input from the keyboard in an xterm window that does NOT contain the I-beam. The cursor is the rectangular shape that tracks the precise location within the window where your keyboard input or mouse click will be applied. In an active window that will accept input, you should notice several things:

Using the mouse, you can move input control around the screen and from window to window. The mouse is also the device used for opening and closing, resizing, and moving windows. It is also used to access menus and make selections from them. Many X applications will use the actions from the mouse to gather input, for example, through "buttons" that appear in small windows created by the X-based program. Such applications may, for example, generate "pop-up" menus that appear automatically from within the program. These pop-up menus may require that you choose an option button or enter information from the keyboard to continue the program. Such menus or required interaction are normally explained in the man page for the specific application.

In this document, we use several terms that describe actions using the mouse, and they have precise meanings. These are some of the things you can do with the mouse and its buttons:




     move            Move the mouse without pressing any buttons.

     press           Press and hold a mouse button.

     release         Release the pressed mouse button, for example,

                        to select a menu item.

     click           Press and release the mouse button, for example,

                        to open a window listed in the Icon Manager.

     double-click    Click the mouse button twice in quick succession.

     drag            With a mouse button pressed, move the mouse.



The scrollbar in a window is the gray, or partially shaded region down the side of a window. When you position the mouse pointer in the scrollbar region of the window, you have four options. Imagine that the window is a scroll that continues above the top boundary of the window, with the bottom of the scroll being the last line of text. The bar in the scrollbar region indicates the part of the scroll that is visible to you, as well as where you are located within the scroll. For example, if the bar occupies the middle third of the scrollbar region, you would be viewing the second of a three-page document. You can change the portion you are viewing in four ways. Click the left button to move down one screen full of text or click the right button to visually move up one screen at a time. Click the middle mouse button at any location in the scrollbar to jump to a screen of text at that location in the scroll. The fourth method, dragging the scrollbar pointer up or down, enables you to "scroll through" the available lines of text.

When you make a request of an X application and there is some delay while work is being performed, the application may display an hourglass or a clock to indicate that you are to wait. This symbol will then change back to the application's usual pointer symbol when the work is complete.

Using the mouse, you can "copy-and-paste" between most windows. To "copy" the information, click the I-beam to the left of the first character of the text you want to pick up. Move the mouse to after the last character of the text that you want to pick up, and click on the third mouse button. The region will be highlighted (perhaps darkened). To "paste" the information in another location, move the mouse to that spot, as indicated by the I-beam or related cursor, and click Button2 (middle). The text that was picked up will be laid down after the cursor's current position. This technique can be used to copy text to any location that is expecting input from the keyboard; e.g., to a command line or input line of an application's pop-up window or into a file being edited.

Keyboard

The keyboard looks much like that of a typewriter, with some extra keys. Of these keys, the meta and control keys are of particular importance.

On all keyboards there is a control key, clearly labeled and frequently used. Also, there is a "meta" key on most keyboards. It is labeled Left or Right on the SPARCstations, and ALT on most other keyboards. There are many other labels on the various workstation keyboards, but their function is beyond the scope of this document.

Some X programs require that you use the mouse buttons along with a keyboard key called a modifier key. In X terminology the modifier keys are Shift, Control and Meta. In effect, they could give you three more levels of mouse buttons. We have used this feature to give you another means for raising or lowering a window, as described in the "Windows" section.

Menus

There are four menus that are a part of the ITC default confi- guration. They are called "User Defined Menus" because you can change them in the window manager file. For the Tab Window Manager, the .twmrc file is the one in which these menus are specified. Three of them have been set up to act in the root (background) area of your screen. The fourth works through the titlebar region of any window.

The four menus are displayed in Figure 2. The regions in which they are active and the identifier name for each are specified in the .twmrc file by the following lines:




          #       Button  = KEYS : CONTEXT : FUNCTION

          #

          --------------------------------------------------------

                  Button1 =      : root    : f.menu "TwmMenu"

                  Button2 =      : root    : f.menu "HostMenu"

                  Button3 =      : root    : f.menu "AppMenu"

                  Button3 =      : title   : f.menu "w_name_menu"



You can refer to the man page for twm for more details on allowable keys, contexts, and functions. Although we have not provided "walking" menus, where one selection refers to another entire menu, it is possible to chain menus. This feature is covered in the discussion of TWM in U-014A, "More About X Windows."

To access a menu, you must move the mouse pointer to the region in which the menu is active and then press the correct mouse button to display the menu. To select an item, press the applicable mouse button and hold it down while you drag the pointer to the entry you want to select. Then release the button. Several seconds may pass before your selection takes effect, so please be patient. New users are often tempted to become "trigger-happy," selecting an option again before the results of the first try have had a chance to appear.

Menu Button1Menu Button2
Window Commands
Refresh Screen
Resize a Window
Move a Window
Raise a Window
Destroy a Window
Re-read .twmrc
Print a Window
Print Whole Screen
EXIT Window Manager
Remote Systems
blue.unix
config.mail
ultra1-12.unixlab
sgi-3.unixlab
o200-3.sp2
splogin.sp2
Menu Button3Menu w_name_menu
Applications
New Window
Big Window
Calculator
Calendar
Dictionary
Font Selector
Manual Browser
News Reader
Window Name Menu
Raise Window To Top
Lower Window To Bottom
Resize Window
Move Window
Print Window
Destroy Window

Figure 2. User Defined Menus

The Applications menu is accessed by pressing Button3 in the root area of the screen. When you drag the mouse pointer down the menu and select an application, the command to run the application is given automatically. Within several seconds a window or the frame of a window will appear. If an outline of a window comes up, representing the window, first move this frame to a convenient place on the screen and then click Button1 to activate the window. Some windows have a specified geometry that places them on the screen, and you will not need a mouse click to activate these windows. The applications listed on this menu are discussed briefly later in this document in the section entitled "Applications."

The Remote Systems menu is accessed by pressing Button2 (middle) in the root area of the screen. The command issued by these menu selections has two parts: it creates an xterm window and starts an rlogin session on the remote machine selected. You can select a machine (on which you have an account) by dragging the mouse to that name in the list and releasing. The list provided consists of ITC RS/6000 machines. You may edit the appropriate entries in the .twmrc file to show machines on which you have an account. The line(s) to change will be similar to the following:

"blue" !"xterm -title 'BLUE' -sb -e rlogin blue.unix.Virginia.EDU &"

The Window Commands menu is accessed by pressing Button1 (left) in the root area. These commands act on windows, as listed. Some of them perform other "window management" functions. For example, the selection "Re-read .twmrc" may be used if you have modified that file and want to test it without having to start X from scratch. The selections "print a window" or "print whole screen" enable you to generate a snapshot of the current contents of the window or screen.

The last selection in the Window Commands menu is the one you make when you have completed your work and are ready to leave the workstation. "EXIT Window Manager" causes all processes that are running under the window manager to terminate. For this reason, before you make this selection, check your windows, open and minimized, to make sure all jobs you may have started have completed.

The fourth menu, called Window Name Menu, is accessed by pressing Button3 in the titlebar region (where the window's name appears). This menu contains commands that are specific to that one window. If you select the option to "Destroy Window," any processes started from that window may be terminated.

In addition, a specific application may have its own menus through which you can interact with that program. These specialized menus will be explained in the man page for the particular application. Three additional menus, which will not be discussed in these notes, are provided by the X Windows System and come with the xterm command. They are accessed using the CONTROL key with the mouse buttons when the mouse pointer is in a window region. These menus are described in the man page for xterm.

Windows

Window programs are of two types: output only and input/output. Output-only windows only display information, like the clock. Input/output windows allow you to interact with them. An example of an input/output program is xterm, which emulates a terminal interface either to the workstation or to some other computer to which you have connected over the network.

Windows may be thought of as pieces of paper that you can move around and rearrange. You can raise or lower a window within a stack of windows, and resize, open, minimize, and close (destroy) windows.

A window can be either open or minimized. When it is open, you can use it and observe its output. When you aren't using the window, but may want to access it again soon, or if you have work going on in the window, you can minimize it and put it aside. The work will continue as long as no user input is needed. With the Tab Window Manager (TWM), we have set up an Icon Manager window that lists the names of most of the windows, and displays the symbol x beside the name to show when a window is closed.

Had we not chosen to use an Icon Manager, a small rectangular picture would have appeared for each closed window, similar to those for the clock and mailbox. These small pictures are called free "icons." They visually remind you of a window that is closed. Some X programs don't display a small picture as their icon, but instead display a small rectangle with the name of the window in it, (e.g., the calendar application). Like windows, free icons can be rearranged, stacked, and moved; unlike windows, they cannot be resized.

Many of the following means for initiating certain actions have been specified in the .twmrc file in the section where the mouse key actions are defined. Further discussion of user-defined options is given in U-014A, "More About X Windows."

You can MOVE windows in several ways:

In these cases a window outline may appear that can be dragged to a new location. Releasing the mouse button completes the move. Icons, such as the mailbox, may be moved by dragging the icon with Button2.

To MINIMIZE a window, click any mouse button on the far left square of the title region. Your Icon Manager has been set up to show most minimized windows with an "x" next to its icon in the Manager list. To REOPEN a window, click on its icon or its name in the Icon Manager list.

To RESIZE a window use one of the following methods:

A window outline will appear. Move the outline in, out, up, and down until you are satisfied with the new size and then release the button.

To RAISE or LOWER a window, you can:

To DESTROY or remove a window, use one of the following:


APPLICATIONS

In the explanations of X programs in this section, information is given on how to modify the application or tailor its appearance. Information on geometry, color, the setting of resources, and other window managers is given in U-014A, "More About X Windows." The following instructions are given to help you get started with an application, for more information,see the application man page.

If you are running an application from a remote machine, please refer to the section "Setting the DISPLAY" for instructions. Your workstation must be allowed to act as a display for the program, and the remote machine must be told where to send the display information.

The Applications menu referred to in the paragraphs below is the one which is set up in the default .twmrc file given to new users. Thus, mouse Button3 is used to access the menu while in the root area of the screen. If your menus are not set up this way, you may still issue the command to run an application from the command line within any xterm window.

xman

The manual page browser provides interactive access to the documentation available on line, not only for X applications, but for Unix commands as well. It not only provides access to the documentation, but can serve as a helpful device when you can't remember a precise command or are simply curious about what commands are available. The tool is an instructive device, giving you a list of commands whose names may indicate their usefulness to you. The lists are kept up-to-date with currently available software. You can discover new tools by browsing the command lists.
xman The initial window shown here has buttons to allow you to get Help, to Quit, or to select a Manual Page. When you choose Manual Page, a new window appears. If you select the "Sections" pull-down menu you are presented with a
list of sections which will look something like: User Commands, System Calls,Subroutines, Devices, File Formats, Games, Miscellaneous, and Sys. Administration but may be different for different machines. If you select the User Commands, you will be presented with a list of commands. There is a scrollbar along the side of this window that you can use to scan the list. Clicking on a command automatically brings the text of the man page for that command into the window. You can go back to the original list by pressing the "Options" button and selecting "Display Directory."

You may bring up the Manual Browser from the Applications menu, which is accessed by pressing Button3 while the mouse pointer is in the root region of the screen. Alternatively, issue the command xman in an xterm window. To learn more about the Manual Browser, access its man page by selecting the User Command xman or by typing man xman at the Unix prompt.

xcalc

Calculator The calculator is also available from the Applications menu. It may also be started with the command xcalc. The calculator accepts the standard toolkit options for geometry and color. Its default emulation is that of a TI-30. The option -rpn enables Reverse Polish Notation so that the calculator looks and behaves like an HP-10C. You can remove the calculator by typing q when the mouse pointer is in the display region.

xcalendar

This is a simple interactive program with notebook capability. Entries are saved in the directory Calendar that is created in your home directory. The calendar is available through the Applications menu, or may be invoked with the command xcalendar. Mouse Button1 is used to access the dates and control options with this application.

XCalendar The current month will display when the calendar window appears. You can move back to previous months by click- ing on the left-facing arrow, and you can move forward by clicking on the right-facing arrow. To obtain helpful information on the use of the calendar, click the "?" symbol in the lower right corner. You can quit the calendar, saving any information you may have entered, by clicking the "Q" in the lower left corner. To make an entry for a specific date, or to check appointments, click the mouse button while the cursor is sitting above the digits for that date. A window outline will appear for you to activate, and you can enter or read the information it contains. Click "Save" or "Done" to close the date's window. Dates with entries are highlighted.

There are several items that can be modified by setting the appropriate resources. These include the names of days and months and the colors for windows and buttons. The default settings are listed in the man page for xcalendar.

xfontsel

xfontsel

This is a point and click interface for discovering X11 font names. A window is displayed that shows the 14-part name for the font illustrated. Clicking any field name pops up a menu of the possibilities for that field. Whenever a change is made, the font shown is changed accordingly. To run the utility, use the Applications menu or type xfontsel. Pressing the select button of this application copies the name that you have chosen into the X buffer. Pressing Button2 on the mouse while the pointer is over a text area will paste the name into the window as if you had typed it there.

xplaces

If you give the command xplaces, a list will be displayed of the X applications that are running. The output, after a little editing, may be used in your initialization file. The command is most useful in the context of the TWM and TVTWM window managers. With these two window managers, the size is displayed in the upper left corner of the screen whenever you resize a window. xplaces is the only mechanism available with TWM and TVTWM for discovering the geometric location of a window. If you use MWM, you can identify the size and geometric position of a window interactively. The pixel coordinates of the location of the upper left corner of a window are displayed in MWM whenever you move a window. The pixel values for the horizontal and vertical dimensions of a window are displayed whenever you resize a window.

xrn

This is an X-based interface to the USENET news system. You can select xrn from the Applications menu or type the command xrn. A large window appears that has three subwindows. The top window lists the newsgroups or, when reading a particular newsgroup, the article headings. The second window provides a set of buttons on which you can click to perform the indicated action. The third window displays the text of the articles when you are in "article" mode. See the man page for xrn for more information.

xdvi

This application allows you to preview a DVI file that has been created from a document formatted with TeX or LaTeX. Pages can be displayed and shrunken by various (integer) factors. A "magnifying glass" allows you to see a small part of the image momentarily. But- tons (and equivalent keystrokes) enable you to step through the docu- ment in increments of one, five, or ten pages at a time, backward and forward. To exit, click the quit option with the left mouse button. Please refer to the man page for xdvi for customization and other options.

xtroff

This is a previewer for troff documents. An example of a command to invoke the previewer with options is:


        xtroff -full -command "troff_command filename" &

where troff_command is the command string that includes all the pro- cessing steps (eqn, tbl, troff, etc.) needed to transform the document into troff output. Giving the above command will cause a large window to be displayed which will show the document as it would appear on an 8.5 x 11 inch page. A menu of xtroff commands can be accessed by pressing Button3 while in the text area of this screen. If you are editing the file in another window, then the command "rerasterize" will process updates to the file without your having to reissue the command. If you have a previously processed file whose output has been saved in a file, you can display it by issuing the command xtroff filename. To exit xtroff, bring up the menu by pressing the right mouse button while in the text window, and select quit from the op- tions. File names and commands can be modified from within the appli- cation. Please see the man page for xtroff for details.

xwebster

This is an X interface to the program "webster" that accesses the on-line copy of Webster's dictionary. The man page is accessed using the command man webster. The utility is accessible through the Applications menu or can be run by issuing the command xwebster. There is a "Help" button on the display.

idraw

This is a drawing editor. It stores the drawings in PostScript files that can be printed on a PostScript printer or included in docu- ments. You can open an existing file or create a new one. A window displays the graphics. There is a set of drawing tools along the side of the window and a set of menus along the top. Other buttons allow you to pan and zoom the view of the drawing. To run the application, type idraw &. The PostScript previewer application, ghostview, can be used to display the image on the screen.


WHERE TO GET HELP

If Your Workstation Does Not Respond

There are several reasons your workstation may be unresponsive. Sometimes you can remedy the problem yourself. First, DO NOT TURN OFF THE MACHINE. As mentioned earlier, these are multi-user machines, and other individuals may be doing work on the machine through a remote connection without your being aware they are there.

If keyboard control has been lost, so that you cannot type, or your mouse will not move, try the following procedures in the order listed:


      o    rlogin from another workstation to your current one.



      o    Type ps aux | grep your_id to discover the process identifica-

           tion numbers (PID).



      o    Lines similar to the following will appear:



      USER     PID  %CPU  %MEM   SZ  RSS TT STAT  START   TIME   COMMAND

     your_id  24114  0.0  10.6  1272 792 co  S   Jul 18 747:07 X :0 -fp /usr/

             lib/X11/fonts/misc,/usr/lib/X11/fonts/75dpi,/usr/lib/X11/fonts

     your_id  24115  0.0  8.5    384 632 co  S   Jul 18   7:07 mwm

     your_id  24112  0.0  0.0     40   0 co IW   Jul 18   0:00 xinit /home/

             your_id/.xinitrc -- /usr/lib/X11/xinit/xserverrc





      o    Kill off the window manager (TWM, MWM, or TVTWM) with the com-

           mand kill -9 PID, matching the PID in the list above.  In this

           example, kill -9 24115 would destroy the window manager MWM.



      o    if that doesn't work, kill the "X :0" process. In the  example

           above, kill -9 24114 would be needed to do this.

On the Suns you sometimes will need to restore control to the keyboard. To do this, type the command kbd_mode -a. If this fails, call the ITC Help Desk at 924-3731 where the staff is available 8:00A.M. to 5:00P.M. Monday through Friday. Student consultants are available in the Small 102 or Thornton E225 labs to assist you.

On-Line Help

Man pages are available on-line. Type man command-name or use the Manual Browser xman. Hard copies of the man pages can be obtained using the command manpage command. Please use this command judicious- ly, since laser printing is costly. From a Unix prompt, help is available with the hints command. When using a Web browser, usr the URL http://www.itc.virginia.edu/desktop/cgi-dtc/newhints.cgi.

Books on X

Douglas A. Young The X Window System O'Reilly & Associates, The X Window System Series Reiss and Radin, X Window Inside & Out

Documents from ITC

U-001, "Unix Resource List"

This document provides a comprehensive list of the Unix documents written for the University community, and includes titles covering the operating system, editors, and applications, e.g. Mail, News, and text processing.

Video Tapes

Information Technology and Communication has placed three sets of tapes in Clemons Library. Produced by AT&T, they are entitled: Fundamentals of the Unix System - Basic, Intermediate, and Advanced Levels.


WE REALLY WANT TO KNOW...
Have you found this publication useful? Are there ways we might improve or supplement it or other ITC publications? Did you find this document in Web or in hard copy? We really want your opinion. Send e-mail to:  newsdesk@virginia.edu