twm | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
NAME | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SYNTAX | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
DESCRIPTION | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
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 description of the variable ShowIconManager and of 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 3x3 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.
OPTIONS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
CUSTOMIZATION | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Much of twm's appearance and behavior can be controlled by providing a startup file in one of the following locations (searched in order for each screen being managed when twm begins):
If no startup files are found, twm will use the built-in defaults described above. The only resource used by twm is bitmapFilePath for a colon-separated list of directories to search when looking for bitmap files (for more information, see the Athena Widgets manual and xrdb(1)).
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.
VARIABLES | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Many of the aspects of twm's user interface are controlled by variables that may be set in the user's startup file. Some of the options are enabled or disabled simply by the presence of a particular keyword. Other options require keywords, numbers, strings, or lists of all of these.
Lists are surrounded by braces and are usually separated by whitespace or a newline. For example:
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 the Pixmaps, Cursors, and IconDirectory below) will prepend 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".
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" }
"winname" ["iconname"]"geometry" columns
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" "=300x5+800+5"5 "myhost" "=400x5+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.
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.
Pixmaps { TitleHighlight "gray1" }
The default for TitleHighlight is to use an even stipple pattern.
SaveColor { BorderColor TitleBackground 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" justificationnumdenom
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 00 "xterm1" left 13 "xterm2" left 23 "oclock" center00 "emacs" right 00 }
The DontSqueezeTitle list can be used to turn off squeezing on certain titles.
The following variables must be set after the fonts have been assigned, so it is usually best to put them at the end of the variables or beginning of the bindings sections:
BINDINGS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
After the desired variables have been set, functions may be attached titlebuttons and key and pointer buttons. Titlebuttons may be added from the left or right side and appear in the titlebar from left-to-right according to the order in which they are specified. Key and pointer button bindings may be given in any order.
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
or
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.
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:
MENUS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Functions may be grouped and interactively selected using pop-up (when bound to a pointer button) or pull-down (when associated with a titlebutton) menus. Each menu specification contains the name of the menu as it will be referred to by f.menu, optional default foreground and background colors, the list of item names and the functions they should invoke, and optional foreground and background colors for individual items:
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 twm-supplied 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.
ICONS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
An icon manager is a window that contains names of selected or all windows currently on the display. In addition to the window name, a small button using the default iconify symbol will be displayed to the left of the name when the window is iconified. By default, clicking on an entry in the icon manager performs f.iconify. To change the actions taken in the icon manager, use the the iconmgr context when specifying button and keyboard bindings.
Moving the pointer into the icon manager also directs keyboard focus to the indicated window (setting the focus explicitly or else sending synthetic events NoTitleFocus is set). Using the f.upiconmgr, f.downiconmgr f.lefticonmgr, and f.righticonmgr functions, the input focus can be changed between windows directly from the keyboard.
BUGS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
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.
FILES | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
$HOME/.twmrc.<screen number> $HOME/.twmrc /usr/lib/X11/twm/system.twmrc
ENVIRONMENT VARIABLES | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
SEE ALSO | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
AUTHORS | Début | Précédent | Suivant | Sommaire | Préc.page.lue | Accueil |
Sommaire | Début | Suivant | Sommaire | Préc.page.lue | Accueil |
Table des mots clés | Début | Suivant | Sommaire | Préc.page.lue | Accueil |