Page: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
This program is usually started by the user's session manager or startup script. When used from xdm(1) or xinit(1) without a session manager, twm is frequently executed in the foreground as the last client. When run this way, exiting twm causes the session to be terminated (i.e., logged out).
By default, application windows are surrounded by a "frame" with a titlebar at the top and a special border around the window. The titlebar contains the window's name, a rectangle that is lit when the window is receiving keyboard input, and function boxes known as "titlebuttons" at the left and right edges of the titlebar.
Pressing pointer Button1 (usually the left-most button unless it has been changed with xmodmap) on a titlebutton will invoke the function associated with the button. In the default interface, windows are iconified by clicking (pressing and then immediately releasing) the left titlebutton (which looks like a Dot). Conversely, windows are deiconified by clicking in the associated icon or entry in the icon manager (see the variable ShowIconManager and the function f.showiconmgr).
Windows are resized by pressing the right titlebutton (which resembles a group of nested squares), dragging the pointer over edge that is to be moved, and releasing the pointer when the outline of the window is the desired size. Similarly, windows are moved by pressing in the title or highlight region, dragging a window outline to the new location, and then releasing when the outline is in the desired position. Just clicking in the title or highlight region raises the window without moving it.
When new windows are created, twm will honor any size and location information
requested by the user (usually through -geometry command line argument or resources
for the individual applications). Otherwise, an outline of the window's default size, its
titlebar, and lines dividing the window into a 33
grid that track the pointer are displayed. Clicking pointer Button1 will position the
window at the current position and give it the default size. Pressing pointer Button2
(usually the middle pointer button) and dragging the outline will give the window its
current position but allow the sides to be resized as described above. Clicking pointer
Button3 (usually the right pointer button) will give the window its current position but
attempt to make it long enough to touch the bottom the screen.
Home |
Twm startup files are logically broken up into three types of specifications: Variables, Bindings, Menus. The Variables section must come first and is used to describe the fonts, colors, cursors, border widths, icon and window placement, highlighting, autoraising, layout of titles, warping, use of the icon manager. The Bindings section usually comes second and is used to specify the functions that should be to be invoked when keyboard and pointer buttons are pressed in windows, icons, titles, and frames. The Menus section gives any user-defined menus (containing functions to be invoked or commands to be executed).
Variable names and keywords are case-insensitive. Strings must be surrounded by double
quote characters (e.g. "blue") and are case-sensitive. A pound sign (# ) outside
of a string causes the remainder of the line in which the character appears to be treated
as a comment.
AutoRaise{ "emacs" "XTerm" "Xmh"} or AutoRaise { "emacs" "XTerm" "Xmh" }
When a variable containing a list of strings representing windows is searched (e.g. to determine whether or not to enable autoraise as shown above), a string must be an exact, case-sensitive match to the window's name (given by the WM_NAME window property), resource name or class name (both given by the WM_CLASS window property). The preceding example would enable autoraise on windows named "emacs" as well as any xterm (since they are of class "XTerm") or xmh windows (which are of class "Xmh").
String arguments that are interpreted as filenames (see Pixmaps, Cursors, and IconDirectory below) will propound the user's directory (specified by the HOME environment variable) if the
first character is a tilde (~). If, instead, the first character is a colon
(:), the name is assumed to refer to one of the internal bitmaps that are used to create
the default titlebars symbols: :xlogo or :delete (both refer to the X logo),
:dot or :iconify (both refer to the dot), :resize (the nested squares
used by the resize button), :menu (a page with lines), and :question (the
question mark used for non-existent bitmap files).
The following variables may be specified at the top of a twm startup file. Lists of Window name prefix strings are indicated by win-list. Optional arguments are shown in square brackets:
BorderColor "gray50" { "XTerm" "red" "xmh" "green" }
The default is "black".
Home |
The
following color variables may also be given a list of window and color name pairs to allow
per-window colors to be specified (see BorderColor for details):
BorderColor, IconManagerHighlight, BorderTitleBackground, BorderTitleForeground,
TitleBackground, TitleForeground , IconBackground, IconForeground,
IconBorderColor, IconManagerBackground, and IconManagerForeground.
For example:
Color { MenuBackground "gray50" MenuForeground "blue" BorderColor "red" {"XTerm""yellow"} TitleForeground "yellow" TitleBackground "blue" }
All of these color variables may also be specified for the Monochrome variable, allowing the same initialization file to be used on both color and monochrome displays.
cursorname "string"
where cursorname is one of the cursor names listed below, and string is the name of a glyph as found in the file /usr/include/X11/cursorfont.h (without the "XC_" prefix). If the cursor is to be defined from bitmap files, the following syntax is used instead:
cursorname "image" "mask"
The image and mask strings specify the names of files containing the glyph image and mask in bitmap(1) form. The bitmap files are located in the same manner as icon bitmap files. The following example shows the default cursor definitions:
Cursors { Frame "top_left_arrow" Title "top_left_arrow" Icon "top_left_arrow" IconMgr "top_left_arrow" Move "fleur" Resize "fleur" Menu "sb_left_arrow" Button "hand2" Wait "watch" Select "dot" Destroy "pirate" }
Home |
Home |
where winname is the name of the windows that should be put into this icon manager, iconname is the name of that icon manager window's icon, geometry is a standard geometry specification, and columns is the number of columns in this icon manager as described in IconManagerGeometry. For example:
IconManagers { "XTerm" "= 3005+ 800+ 5" 5 "myhost" "= 4005+ 100+ 5" 2 }
Clients whose name or class is "XTerm" will have an entry created in the "XTerm" icon manager. Clients whose name was "myhost" would be put into the "myhost" icon manager.
Icons { "XTerm" "xterm.icon" "xfd" "xfd_icon " }
Windows that match "XTerm" and would not be iconified by unmapping, and would try to use the icon bitmap in the file "xterm.icon". If ForceIcons is specified, this bitmap will be used even if the client has requested its own icon pixmap.
Home |
Menu "mymenu " { "Title" ("black":"red") f.title "entry1" f.nop "entry2" f.nop "entry3" ("white":"green") f.nop "entry4" f.nop "entry5" ("red":"white") f.nop }
the foreground colors for "entry1" and "entry2" will be interpolated between black and white, and the background colors between red and green. Similarly, the foreground for "entry4" will be half-way between white and red, and the background will be half-way between green and white .
Home |
Home |
Pixmaps { TitleHighlight "gray1" }
The default for TitleHighlight is to use an even stipple pattern.
Home |
SaveColor { BorderColor Title Background TitleForeground "red" "green" "blue" }
This would place on the root window 3 pixel values for borders and titlebars, as well as the three color strings, all taken from the default colormap.
"name" | justification num denom |
where name is a window name, justification is either left, center or right, and num and denom are numbers specifying a ratio giving the relative position about which the titlebar is justified. The ratio is measured from left to right if the numerator is positive, and right to left if negative. A denominator of 0 indicates that the numerator should be measured in pixels. For convenience, the ratio 0/0 is the same as 1/2 for center and -1/1 for right. For example:
SqueezeTitle { "XTerm" left 0 0 "xterm1" left 1 3 "xterm2" left 2 3 "oclock" center 0 0 "emacs" right 0 0 }
The DontSqueezeTitle list can be used to turn off squeezing on certain titles.
Home |
Home |
Titlebuttons specifications must include the name of the pixmap to use in the button box and the function to be invoked when a pointer button is pressed within them:
LeftTitleButton"bitmapname" = function |
RightTitleButton"bitmapname"= function |
The bitmapname may refer to one of the built-in bitmaps (which are scaled to match TitleFont)by using the appropriate colon-prefixed name described above.
Key and pointer button specifications must give the modifiers that must be pressed, over which parts of the screen the pointer must be, and what function is to be invoked. Keys are given as strings containing the appropriate keysym name; buttons are given as the keywords Button1-Button5:
"FP1 " | = modlist: context : function | |
Button1 | = modlist: context : function |
The modlist is any combination of the modifier names shift, control, lock, meta, mod1, mod2, mod3, mod4, or mod5 (which may be abbreviated as s, c, l, m, m1, m2, m3, m4, m5, respectively) separated by a vertical bar (|). Similarly, the context is any combination of window, title, icon, root, frame, iconmgr, their first letters (iconmgr abbreviation is m), or all, separated by a vertical bar. The function is any of the f. keywords described below. For example, the default startup file contains the following bindings:
Button1 | = | : root | : f.menu "TwmWindows" |
Button1 | = m | : window | icon | : f.function "move-or-lower" |
Button2 | = m | : window | icon | : f.iconify |
Button3 | = m | : window | icon | : f.function "move-or-raise" |
Button1 | = | : title | : f.function "move-or-raise" |
Button2 | = | : title | : f.raiselower |
Button1 | = | : icon | : f.function "move-or-iconify" |
Button2 | = | : icon | : f.iconify |
Button1 | = | : iconmgr | : f.iconify |
Button2 | = | : iconmgr | : f.iconify |
A user who wanted to be able to manipulate windows from the keyboard could use the
following bindings:
"F1" = | : all | : f.iconify | ||
"F2 " = | : all | : f. raiselower | ||
"F3" = | : all | : f.warpring "next" | ||
"F4" = | : all | : f.warpto "xmh" | ||
"F5" = | : all | : f.warpto "emacs" | ||
"F6" = | : all | : f.colormap "next" | ||
"F7" = | : all | : f.colormap "default" | ||
"F20" = | : all | : f.warptoscreen "next" | ||
"Left"= m | : all | : f.backiconmgr | ||
"Right" | = m | s | : all | : f.forwiconmgr | |
"Up" = m | : all | : f.upiconmgr | ||
"Down" | = m | s | : all | : f.downiconmgr |
Twm provides many more window manipulation primitives than can be conveniently stored in a titlebar, menu, or set of key bindings. Although a small set of defaults are supplied (unless the NoDefaults is specified), most users will want to have their most common operations bound to key and button strokes. To do this, twm associates names with each of the primitives and provides user-defined functions for building higher level primitives and menus for interactively selecting among groups of functions.
User-defined functions contain the name by which they are referenced in calls to f.function and a list of other functions to execute. For example:
Function "move-or-lower " | { f.move f.deltastop f.lower } |
Function "move-or-raise " | { f. move f. deltastop f. raise } |
Function "move-or-iconify " | { f.move f.deltastop f.iconify } |
Function "restore-colormap " | { f.colormap "default" f.lower} |
The function name must be used in f.function exactly as it appears in the function specification.
Home |
In the descriptions below, if the function is said to operate on the selected window, but is invoked from a root menu, the cursor will be changed to the Select cursor and the next window to receive a button press will be chosen:
Home |
Home |
Menu "menuname"[("deffore":"defback")] { string1 [("fore1":"backn")]function1 string2 [("fore2":"backn")]function2. . . stringN [("foreN":"backN") ] functionN }
The menuname is case-sensitive. The optional deffore and defback arguments specify the foreground and background colors used on a color display to highlight menu entries. The string portion of each menu entry will be the text which will appear in the menu. The optional fore and back arguments specify the foreground and background colors of the menu entry when the pointer is not in the entry. These colors will only be used on a color display. The default is to use the colors specified by the MenuForeground and MenuBackground variables. The function portion of the menu entry is one of the functions, including any user-defined functions, or additional menus.
There is a special menu named TwmWindows which contains the names of all of the client and twmsupplied windows. Selecting an entry will cause the WindowFunction to be executed on that window. If WindowFunction hasn't been set, the window will be deiconified and raised.
Home |
The IconRegion variable should take a list.
Double clicking very fast to get the constrained move function will sometimes cause the window to move, even though the pointer is not moved.
If IconifyByUnmapping is on and windows are listed in IconManagerDontShow but not in DontIconifyByUnmapping, they may be lost if they are iconified and no bindings to f.menu "TwmWindows" or f.warpto are setup.
Home |
When uwm is invoked, it searches a predefined search path to locate any uwm
startup files. If no startup files exist, uwm initializes its built-in default
file.
If startup files exist in any of the following locations, it adds the variables to the
default variables. In the case of contention, the variables in the last file found
override previous specifications. Files in the uwm search path are:
/usr/lib/X11/uwm/system. uwmrc
$HOME/.uwmrc
To use only the settings defined in a single startup file, include the variables resetbindings,
resetmenus, resetvariables at the top of that specific startup file.
Home |
pushrelative indicates that the number entered with the push variable represents a relative number. When an f.push function is called, the window is invisibly divided into the number of parts you entered with the push variable, and the window is moved one part.
Home |
Function and mouse events are required input. Menu name is required with the f.menu function definition only.
f.menu=[control key(s)]:[context]:mouse events:" menu name "
Home |
You can bind one, two, or no control keys to a function. Use the bar (|) character to combine control keys.
Note that client applications other than the window manager may use pointer button and control key combinations. If the window manager has bound these combinations for its own use, the client application will never see the requested pointer input.
Home |
The root context refers to the root, or background window, A
(null) context is indicated when the context field is left blank, and allows a function to
be invoked from any screen location. Combine contexts using the bar (|) character.
With the specific button, you must identify the action of that button. Mouse actions can be:
menu = " menu name " { "item name": "action" . . . }
Enter the menu name exactly the way it is entered with the f.menu function or the window manager will not recognize the link. If the menu name contains blank strings, tabs or parentheses, it must be quoted here and in the f.menu function entry. You can enter as many menu items as your screen is long. You cannot scroll within menus.
Any menu entry that contains quotes, special characters, parentheses, tabs, or strings of blanks must be enclosed in double quotes. Follow the item name by a colon (:).
Strings starting with an up arrow (^) will have a new line character appended to the string after the up arrow (^) has been stripped from it.
Strings starting with a bar character (|) will be copied as is after the bar character (|) has been stripped.
Home |
Color Menus
Use the following syntax to add color to menus:
menu = "menu name" (color1:color2:color3:color4){ "item name" : (color5 :color6) : "action" . . . }
1) If you run out of color map entries, either before or during an invocation of uwm.
2) If you specify a foreground or background color that does not exist in the RGB color database of the server (see usr/lib/X11/rgb.txt for a sample) both the foreground and background colors default to the root window colors.
3) If you omit a foreground or background color, both the foreground and background colors default to the root window colors.
4) If the total number of colors specified in the startup file exceeds the number specified in the maxcolors variable.
5) If you specify no colors in the startup file.
Home |
menu = "EXTENDED WINDOW OPS" { Create Window: !"xterm &" Iconify at New Position: f.lowericonify Focus Keyboard on Window: f.focus Freeze All Windows: f.pause Unfreeze All Windows: f.continue Circulate Windows Up: f.circleup Circulate Windows Down: f.circledown }
Some versions of lex
have a hard-wired input buffer limit of 200 characters with no checking for overflow. A
.uwmrc file containing lines longer than this limit will cause unpredictable behavior when
used with a version of uwm built on such a system.
COPYRIGHT © 1985,1986,1987,1988
DIGITAL EQUIPMENT CORPORATION
MAYNARD, MASSACHUSETTS
THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT
NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITIBILITY OF THIS SOFTWARE FOR ANY PURPOSE.
IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT RIGHTS,
APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN ADDITION TO THAT SET FORTH
ABOVE.
Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital Equipment Corporation not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.
Home |
Contents | Previous Chapter | Chapter 1 Cont. | Next Chapter |