THE UNIVERSITY
                             OF  BIRMINGHAM

                       School of Computer Science

              CTWM - THE DEFAULT WINDOW MANAGER FOR NEW USERS

CONTENTS

 --  Introduction: using machines on our Unix network
 --  Desktop computing vs "remote" computing
 --  How to log in
 --  The Chooser panel
 --  The Login panel
 --  What you see when you log in
 --  Manipulating windows
 --  1. Moving a window.
 --  2. Raising or lowering a window
 --  3. Resizing a window
 --  4. Destroying or closing a window
 --  Invoking menus
 --  1. CTWM Menu
 --  2. Main Menu
 --  3. Tool manu
 --  4. The WinOps Menu
 --  5. The "Zoom" menu
 --  Exercises
 --  Further information
 --  WARNING

Introduction: using machines on our Unix network
------------------------------------------------
The School of computer science has an elaborate network of computers
including a number of PCs (mostly running NT), a large collection of
Unix workstations (including Sun UltraSparc workstations and Digital
Alpha Unix workstations), NCD Xterminals, Apricot PCs configured as
Xterminals, "compute servers", a large communal file server, and other
machines providing computing and networking facilities.

This document explains what to expect when you log in to one of the
Unix machines. This could be either:

    1. A Sun workstation (usually either Sun Ultra 5 or Sun Ultra 10)
    2. A Digital Alpha Unix workstation
    3. An NCD Xterminal
    4. A PC configured as an Xterminal
    5. A PC running NT, which allows you to access our Unix network
       by running the eXceed program.

This document gives no information on the use of other PC software. When
you are connecting to a Unix machine in one of the above ways, please do
NOT assume that things you have previously learnt to do on a PC will
work here. Instead, follow the instructions provided and take the
trouble to learn how to use our systems.


Desktop computing vs "remote" computing
---------------------------------------
When you use one of the Sun or Alpha workstations you will typically run
programs on the machine you are using. When you log in to one of the NCD
Xterminals or PCs configured as Xterminals, you will have a keyboard
and screen which behave as if you are using a workstation, but your
programs will be running remotely on one of the school's compute
servers.

For undergraduates and MSc students there are four compute servers which
are Sun Sparc computers in the computer room on the lower ground floor.
They are called Tinky-winky (dual processor ultrasparc), Dipsy (dual
processor ultrasparc), Laa-laa (dual processor ultrasparc), Po (twin
processor hypersparc) and Noo-Noo (quad processor hypersparc). Each can
support many simultaneous remote users.

There are also compute servers provided for staff and research
students, which undergraduates and MSc students are not allowed to use.

It is possible when using a workstation to access the remote servers and
run programs on them. E.g. if you are using a Digital workstation you
may need to run Sun software, which you can do by logging in to one of
the Suns, from the workstation. Sometimes while you are using a Sun or
Digital workstation someone else will be using it as a remote compute
server.

For that reason you must NEVER switch off our workstations when you
leave them. (You can switch of monitors however. If you don't know the
difference, please don't switch off anything.)

Whichever machine you log into you will be able to access the same file
system on a large Sun file server called "casper". Your login directory
is stored on that machine, and will be associated with your user name.

When your "account" on our network is created you are given a user name
and a login password, your directory is set up, and some initial files
and subdirectories created which control what happens when you log in.

Later you may wish to change the login scripts, but beware of doing so
without consulting your course tutors. Often students take advice from
well-meaning "expert" friends, and end up being unable to log in because
they have corrupted their startup files.

The setup for new users arriving in or after September 1998 is different
from that used previously, so do not take advice on login scripts from
students who arrived earlier.

How to log in
-------------
When you come to a terminal or workstation press the "SHIFT" key
or move the mouse slightly to wake up the terminal, if the screen is
dark. Some monitors have a "power saving" facility which turns off the
monitor power if the keyboard is not used for some time. It can take a
few seconds for the power to return and the screen to light up after
you wake it up.

The Chooser panel
-----------------
If you sit at an Xterminal or PC configured as an Xterminal you may find
that you are confronted with a "chooser" panel offering you the option
to log in to one of the compute servers (e.g. po, laa-laa or dipsy).

Choose one of them. If you vary your choice randomly the distribution of
users on the servers will be evened out in the long run. When you have
chosen your server you can click (with left mouse button) on "OK" and
you will be connected to the server. After that you will see a login
panel.

If you come to a Sun or Digital workstation, you will simply see the
login panel, not a chooser panel.

The Login panel
---------------
When confronted with a login panel move the mouse cursor onto the panel
then type your user name and press the RETURN key. This is usually a big
key to the right of the central collection of alphabetic keys. It may
have the word "Return" on it, or possibly a big bent arrow pointing
left.

A flashing text cursor will move to the "password" prompt. Type in your
password (which will not be echoed onto the screen) then press the
Return key again.


What you see when you log in
----------------------------

The login panel will disappear and the window manager (ctwm) will start
up, with a number of windows and panels displayed on your screen. The
defaults may be different for different students.

1. Normally there will be a small "console" panel near the bottom of the
screen, where error messages may appear. You can also type unix commands
in there.

2. There will also be a panel marked "quit" or "Exit". You should click
on that when you are ready to log out. However before logging out you
should FIRST make sure you exit from all applications, including
especially Netscape, Emacs or Xved. Otherwise you may leave "runaway"
processes on the machine after you log out.

3. There may be a window labelled "MOTD" containing the "message of the
day" from the system manager. Read it then click on the "Okay" button to
make it go away.

4. You will have an "xbiff" window showing a mailbox, which indicates
when you have new mail waiting to be read (the flag goes up and the box
changes colour when there is mail for you.)

5. An "icon manager" will appear on the right edge of the screen below
the top. For each "manageable" window it will show the name of the
window in a horizontal box. By clicking on that box you can cause the
corresponding window to switch between being "open" and being
"iconified". When it is "iconified" there is a little rectangular box
with the name of the window near the bottom of the screen (though it may
be covered). That's the "icon" for the window. If you click on the icon
it will "open" the window and the icon will then disappear.

You can also close a window by clicking on its title bar (if it has one)
using the right mouse button, or by clicking on the little square with a
dot in the middle at the top left of a window.

Try all those ways of iconifying and de-iconifying various windows. See
where the iconified versions go.

6. A Workspace manager window will be found in the bottom right corner
of the screen. This window has four panels. Each panel corresponds to a
"virtual desktop", i.e. a workspace in which you can locate windows.
There is always a current workspace. You can move to a new workspace
either by clicking in one with the left mouse button or by holding down
the Control key, and pressing the left arrow or right arrow on the
central arrow keypad.

Some users have the workspace manager configured as a two by two array
of panels and some as a horizontal row of panels.

Initially you will probably need only one workspace. Later you may find
it convenient to locate different windows in different workspaces, so
that they don't get in one another's way. There are mechanisms for
making some windows appear in several different workspaces. The CTWM
window manager offers a large collection of options, which would be too
confusing to describe here.

Manipulating windows
--------------------

The window manager (ctwm) provides many operations which can be
performed on individual windows. Most of these are usually performed
using the mouse, though some can make use of the keyboard, using
so-called "accelerators". This section describes some of the most common
operations. Additional information is available from the sources listed
at the end.

1. Moving a window.
-------------------
You can move a window by clicking and holding down the left mouse button
while the mouse cursor is on the title bar or the frame surrounding the
window. However if it is an iconified window, using the left button will
de-iconify it, so to move an icon use the MIDDLE mouse button. On a
mouse with only two buttons, click or hold down both buttons
simultaneously to achieve the effect of using the middle button (or
button 2).

If you find it too fiddly to locate the frame or title bar when moving a
window you can hold down the "META" key (usually to the left or right of
the space bar, often marked with a diamond), then use mouse button 1
anywhere in the window. When you attempt to move a window you may find
that what actually moves is a "wire frame" representing the new
location. When you release the mouse button the window will jump to
where the frame was.

Try moving some of the windows on your screen using both the above
methods.

2. Raising or lowering a window
-------------------------------
Sometimes one window will partly or wholly obscure another. If a window
is partly obscured you can bring it to the top (or "raise" it) by any of
the following means, though if it is already at the top it will be moved
to the bottom of the pile ("lowered").

    (i)  Click on title bar or frame with middle mouse button
   (ii)  While holding down the Meta key click anywhere in the window
         with middle mouse button.
  (iii)  Hold down the Meta key and press function key F1. The window
         containing the current input focus will be affected.
   (iv)  Use the "window ops" button second from the right on the
         window's title bar.

If you simply use the left mouse button on the title bar or frame that
will raise the window but not lower it.

3. Resizing a window
--------------------
The most common way to do this is to use the "resize" button at the
right of the title bar of the window. The button has a number of nested
squares, to indicate its role in changing size. If you put the the mouse
cursor on that window button then hold down mouse button 1, the mouse
cursor will switch to a cross in a circle, and a "wire-frame" will
appear giving the window's current outline. By moving the mouse cursor
across the top, bottom, left or right boundary of the window and back
again if necessary you can vary the size of the window. If you wish to
change only the height move across the top or bottm edge. If you wish to
change only the width, move across the left or right edge. If you wish
to change both by moving a corner of the window, move the cursor past
the corner to "capture" it so that you can move it with the mouse.

When you release the mouse button the window will have the new size.
While you are changing the size a little panel will appear in the top
left of the screen telling you the current size of the window. If it is
an xterm window or a text editing window it may tell you the size in
text rows and columns. Otherwise it will tell you the size in pixels.

Another way to resize a window is to use the "zoom" options associated
with some of the menus described elsewhere.

4. Destroying or closing a window
---------------------------------

There are two cases to consider.

4.a. Removing a window because you wish to destroy the whole process of
which that is a part. To do this you can select the "destroy" option on
the "window ops" menu attached to the little icon next to the resize
icon on the title bar of each window, or you can invoke the main CTMW
menu as described below under "invoking menus"m, and select the
"destroy" option.

4.b. Remove one of several windows all produced by the same process,
e.g. one of the file buffers produced by a multi-window editor. If you
select the "destroy" options as described in 4.a you will kill the whole
process, not just the unwanted window. So instead you should select the
option marked "close" or "delete". This is "weaker" than destroy: it
allows the process managing the window to decide what to do.


Invoking menus
--------------

The ctwm window manager provides a number of menu facilities, which can
be changed by altering your .ctwmrc file. However the default setup
provides the following menus which can be invoked by using the mouse
buttons in the screen "root" area, i.e. outside any of the windows on
the screen, and sometimes in other areas with extra keyboard buttons
pressed, e.g. Shift, Control or Meta.

1. CTWM Menu
------------
This menu is invoked in the root window by button 1, and if the Meta and
Shift keys are both held down, it can be involved by button 1 in any
context. This menu provides a number of operations on windows. Some of
them will require you to specify a window. It will show this by
replacing the normal mouse cursor with a black ball or perhaps a cross
in a circle, or in the case of destroy or delete options a "deaths
head".

Move it to the window you wish the operation to be applied to and click
there.

2. Main Menu
------------

This menu is invoked in the root window by button 2 (the middle button),
and if the Meta and Shift keys are both held down, it can be involved by
button 2 in any context. This menu provides a number of options to open
new xterm windows on the current machine or to open new xterm windows
logged in to one of the Sun compute servers (e.g. Po, Laa-Laa or Dipsy).

For some groups of users this menu may also include options to start
up Xved or Pop-11 demonstration programs.

(Note: if your mouse contains only two buttons, you should use both of
them together to simulate button 2 (the middle button on a three button
mouse.)

3. Tool menu
------------

This menu is invoked in the root window by button 3 (the right button),
and if the Meta and Shift keys are both held down, it can be involved by
button 3 in any context. This menu provides a number of options to start
up various utility programs.

One of the options in the tool menu is labelled "Xlock". If you select
that it will lock your screen. The screen will go blank and to restart
work you will have to hit the "Return" key and then when requested type
in your login password. This can be useful if you need to leave your
terminal for a minute or two, e.g. to pick up something from a printer.

However you should *never* leave a terminal in one of the laboratories
locked while you are away for more than about 15 minutes. Instead log
out and then log in again when you come back. Students found leaving
terminals locked in order to reserve them will be reported, and will be
subject to disciplinary action, e.g. having their computer account
blocked for a period of time.

4. The WinOps Menu
------------------
This menu brings together a number of the most useful operations that
can be applied to a window. The menu can be invoked only via the icon on
the title bar of a file to the left of the "resize" icon.

5. The "Zoom" menu
------------------

This menu gives the opportunity to do various kinds of rapid change of
size of the window, including stretching vertically to fill the height
of the screen or stretching horizontally. Repeating an option will
reverse its effect.

The menu is found mainly as one item within other menus. However it can
always be invoked by holding down the Meta and Control keys and pressing
button 1 (left button).

Exercises
---------

1. Practise logging in and out.

2. Practise bringing up the main menus either in the root window space
or in other contexts.

3. Practise moving windows about, resizing them, and iconifying and
deiconifying them.

4. Practise moving to a new workspace and creating a new xterm window
there.

5. Practice startup up an xterm window on another machine, e.g. Po, and
then killing it using one of the menus.



Further information
-------------------

Expert users who wish to configure the window manager or discover more
about how to use it should look in two places.

    (a) The unix "man file":  man ctwm
    (b) Your own .ctwmrc file in your login directory.

The latter is the file you will need to edit to change your window
manager configuration. However you MUST make sure you can log in after
changing the file. To do that, write the file then go to another
terminal and see if you are able to log in. If you cannot you will
either have to restore the file to its original state or investigate
further to discover what went wrong. You may find some clues in the file

    /var/adm/xdm-errors

You may also find it helpful to look at the information in the School's
system documentation Web page:
    http://www.cs.bham.ac.uk/system/documentation/login.html

WARNING
-------
Some books on unix and some online user guides give information that is
either out of date or irrelevant to our system. For instance if you read
that the way to log out is to type "logout" ignore that. We have set
things up so that you log out by clicking on the exit window.


=======================================================================
This file maintained by Aaron Sloman
Last updated: 23 Jul 1999
Please report faults and omissions by email to A.Sloman@cs.bham.ac.uk

--- $poplocal/local/teach/ctwm
--- Copyright University of Birmingham 2000. All rights reserved. ------