Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ twm(1X) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

X(1X)

xdm(1X)

XmacII(1X)

xmodmap(1X)

xrdb(1X)




twm(1X) twm(1X)
NAME twm - manages windows SYNOPSIS twm [-display display] [-m] [-s] [-f init-file] [-v] DESCRIPTION twm is a window manager that provides title bars, shaped windows, several forms of icon management, user-defined mac- ro functions, click-to-type and pointer-driven keyboard focus, and user-specified key and button bindings. Options The twm command accepts these options: -display display Specifies the X server to connect to. See (X(1X) for details. -f init-file Specifies the name of the startup script to use. By default, twm looks in the user's home directory for files named .twmrc.number (where number is a screen number) or .twmrc. -m Causes twm to manage all screens on the display. This is the default. -s Indicates that only the default screen (as specified by -display or by the DISPLAY environment variable) should be managed. By default, twm attempts to manage all screens on the display. -v Indicates that twm should print error messages when- ever an unexpected X error event is received. This option can be useful when debugging applications but can be distracting in regular use. Using twm The twm client application is usually started by your ses- sion manager or startup script. When used from xdm(1X) or xinit(1X) without a session manager, twm is frequently exe- cuted in the foreground as the last client. When run this way, exiting twm causes the session to be terminated (that is, logged out). By default, application windows are surrounded by a ``frame'' with a title bar at the top and a special border around the window. The title bar contains the window's name, a rectangle that is highlighted when the window is ac- tive and receiving keyboard input, and icons known as title buttons near the left and right edges. November, 1990 1



twm(1X) twm(1X)
Positioning the pointer on an icon in the title bar and clicking it (by pressing the mouse button or the left button on a three-button mouse) activates the associated function. In the default interface, you iconify windows by clicking the left icon that looks like a small X. This box is called the iconify icon. Conversely, you deiconify window by click- ing the associated icon or entry in the icon manager. (See ShowIconManager in ``Variables'' and f.showiconmgr in ``User-defined functions'' later in the ``Description'' sec- tion). You resize a window by clicking the right icon that resem- bles group of nested squares, dragging the pointer over the edge that is to be moved, and releasing the mouse button when the outline of the window is the desired size. This icon is called the resize icon. Similarly, you move a win- dow by clicking the window's title or highlight area, drag- ging the window's outline to the new location, and releasing the mouse button when the outline is in the desired posi- tion. Clicking in the title or highlight area activates the window without moving it. When new windows are created, twm honors any size and loca- tion information requested by the user through the -geometry command-line option or resources for the individual applica- tions. Otherwise, an outline of the window's default size, its title bar, and lines dividing the window into a 3 x 3 grid for tracking the pointer are displayed. Clicking the mouse button positions the window at the current position and gives it the default size. Pressing the LEFT ARROW key (or the middle button on a three-button mouse) and dragging the window's outline gives the window its current position but allow the sides to be resized as described previously. Pressing the RIGHT ARROW key (or the right button on a three-button mouse) gives the window its current position but makes it long enough to touch the bottom the screen. Customizing twm You can control much of the appearance and behavior of twm by providing a startup script. When twm starts, these direc- tories are searched in the following order for each screen being managed. $HOME/.twmrc.number The screen number specified by number is a small po- sitive number, such as 0 or 1, that represents the last number in the DISPLAY environment variable (host:displaynum.number) and is used to contact that screen of the display. This startup script is in- tended for displays with multiple screens of differ- ing visual types. 2 November, 1990



twm(1X) twm(1X)
$HOME/.twmrc This startup script is the usual name for an indivi- dual user's startup script. /usr/lib/X11/twm/system.twmrc This startup script is often tailored by the site administrator to provide a default configuration of convenient menus or familiar bindings. If twm finds no startup script, it uses the built-in de- faults described earlier. 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 xrdb(1X) and Athena Widget Set - C Language Interface. Startup files for twm are logically broken up into three types of specifications: variables, bindings, and menus. The variables section must come first and is used to describe the fonts, colors, cursors, border widths, icon and window placement, highlighting, autoraising (making the win- dow frontmost), layout of titles, warping, and use of the icon manager. The bindings section usually comes second and is used to specify the functions that should be invoked when keyboard and pointer buttons are pressed in windows, icons, titles, and frames. The menus section gives any user- defined menus, such as functions to be invoked or commands to be executed. Variable names and keywords are case insensitive. Strings must be surrounded by double quotation marks, such as "blue" and are case sensitive. A number sign (#) outside of a string causes the remainder of the line in which the charac- ter appears to be treated as a comment. Variables Many of the aspects of the twm user interface are controlled by variables that may be set in the user's startup script. 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 a space, a tab, or a newline. An example of a list that uses space characters is: AutoRaise { "emacs" "XTerm" } An example of a list that uses newline characters is: AutoRaise { "emacs" November, 1990 3



twm(1X) twm(1X)
"XTerm" } When a variable containing a list of strings representing windows is searched (for example, to determine whether to enable autoraise as in the previous examples), a string is considered to match a window if it is a case-sensitive pre- fix for the window's name (given by the WM_NAME window pro- perty), resource name, or class name (both given by the WM_CLASS window property). The preceding example would en- able the autoraise feature on windows named emacs as well as any xterm windows because they are of class XTerm. String arguments that are interpreted as filenames (see Pix- maps, Cursors, and IconDirectory in this section) prepend the user's directory (specified by the HOME environment variable) if the first character is a tilde (~). But if the first character is a colon (:), the name is assumed to refer to one of the internal bitmaps that is used to create the default title bar icons: :xlogo or :iconify (both refer to the X used for the iconify icon), :resize (the nested squares used for the resize icon), and :question (the ques- tion mark used for non-existent bitmap files). The following variables may be specified at the beginning of a twm startup script. Lists of window-name prefix strings are indicated by window-list. Optional arguments are shown in square brackets. AutoRaise { window-list } Specifies a list of windows that should be raised (moved frontmost on the screen) automatically when- ever the pointer enters one of the windows. This action can be interactively enabled or disabled on individual windows using the function f.autoraise. AutoRelativeResize Indicates that dragging out a window size (either when initially sizing the window with the LEFT ARROW key (or the middle button on a three-button mouse)) or when resizing, twm should not wait until the pointer has crossed the window edges. Instead, mov- ing the pointer automatically causes the nearest edge or edges to move by the same amount. This al- lows the resizing of windows that extend off the edge of the screen. If the pointer is in the center of the window or if the resize is begun by pressing the resize icon, twm still waits for the pointer to cross a window edge. This variable is particularly useful for users who like the press-drag-release method of sweeping out window sizes. 4 November, 1990



twm(1X) twm(1X)
BorderColor string [{ window-color-list }] Specifies the default color of the border to be placed around all non-iconified windows. This vari- able may only be given within a Color or Monochrome list. The optional window-color list specifies a list of pairs of window and color names for specify- ing particular border colors for different types of windows, as in this example: BorderColor "gray50" { "XTerm" "red" "xcalc" "green" } The default is black. BorderTileBackground string [{ window-color-list }] Specifies the default background color in the gray pattern used in unhighlighted borders (only if NoHighlight hasn't been set). This variable may only be given within a Color or Monochrome list. The optional window-color list allows per-window colors to be specified. The default is white. BorderTileForeground string [{ window-color-list }] Specifies the default foreground color in the gray pattern used in unhighlighted borders (only if NoHighlight hasn't been set). This variable may only be given within a Color or Monochrome list. The op- tional window-color list allows per-window colors to be specified. The default is black. BorderWidth pixels Specifies in pixels the width of the border sur- rounding all client window frames if ClientBor- derWidth has not been specified. This value is also used to set the border size of windows created by twm (such as the icon manager). The default is 2. ButtonIndent pixels Specifies the amount by which icons in the title bar should be indented on all sides. Positive values cause the icons (also known as title buttons) to be smaller than the window's title and highlight areas so that they stand out. Setting this variable and the TitleButtonBorderWidth variable to 0 makes icons in the title bar as tall and wide as possible. The de- fault is 1. ClientBorderWidth November, 1990 5



twm(1X) twm(1X)
Indicates that the border width of a window's frame should be set to the initial border width of the window rather than to the value of BorderWidth. Color { color-list } Specifies a list of color assignments to be made if the default display is capable of displaying more than simple black and white. The color list is made up of the following color variables and their values: DefaultBackground DefaultForeground MenuBackground MenuForeground MenuTitleBackground MenuTitleForeground MenuShadowColor Each of the following color variables may also be given a list of pairs of window and color names to allow per-window colors to be specified (see Border- Color earlier in this section for details): BorderColor IconManagerHighlight BorderTitleBackground BorderTitleForeground TitleBackground TitleForeground IconBackground IconForeground IconBorderColor IconManagerBackground IconManagerForeground Here is an example of how to use Color: Color { MenuBackground"gray50" MenuForeground"blue" BorderColor"red" { "XTerm" "yellow" } TitleForeground"yellow" TitleBackground"blue" } All these color variables may also be specified for the Monochrome variable, allowing the same initiali- zation file to be used on both color and monochrome displays. 6 November, 1990



twm(1X) twm(1X)
ConstrainedMoveTime milliseconds Specifies the length of time between mouse button clicks needed to begin a constrained move operation. Clicking the mouse button twice within this amount of time when invoking f.move causes the window only to be moved in a horizontal or vertical direction. Setting this value to 0 disables constrained moves. The default is 400 milliseconds. Cursors { cursor-list } Specifies the shapes that twm should use for various pointers. Each pointer may be defined either from the cursor font or from two bitmap files. Shapes from the cursor font may be specified directly as cursor "string" where cursor is one of the cursor names listed below and string is the name of a shape 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: cursor "image" "mask" The image and mask strings specify the names of files containing the shape image and mask in bitmap(1X) 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" } DecorateTransients Indicates that transient windows (those containing a WM_TRANSIENT_FOR property) should have title bars. By default, transients are not reparented. November, 1990 7



twm(1X) twm(1X)
DefaultBackground string Specifies the background color to be used for sizing and information windows. The default is white. DefaultForeground string Specifies the foreground color to be used for sizing and information windows. The default is black. DontIconifyByUnmapping { window-list } Specifies a list of windows that should not be icon- ified by simply unmapping the window (as would be the case if IconifyByUnmapping had been set). This variable is frequently used to force some windows to be treated as icons while other windows are handled by the icon manager. DontMoveOff Indicates that windows should not be allowed to be moved off the screen. This variable can be overrid- den by the f.forcemove function. DontSqueezeTitle [{ window-list }] Indicates that title bars should not be squeezed to their minimum size as described in SqueezeTitle variable. If the optional window list is given, only those windows are prevented from being squeezed. ForceIcons Indicates that icon pixel maps specified in the Icons variable should override any client-supplied pixel maps. FramePadding pixels Specifies the distance between the title bar icons and text and the window frame. The default is 2 pixels. IconBackground string [{ window-list }] Specifies the background color of icons and may only be specified inside of a Color or Monochrome list. The optional window list is a list of pairs of win- dow names and colors so that per-window colors may be specified. See the BorderColor variable earlier in this section for a complete description of window-list. The default is white. IconBorderColor string [{ window-list }] Specifies the color of the border used for icons and may only be specified inside of a Color or Mono- chrome list. The optional window list is a list of 8 November, 1990



twm(1X) twm(1X)
pairs of window names and colors so that per-window colors may be specified. See the BorderColor vari- able earlier in this section for a complete descrip- tion of window-list. The default is black. IconBorderWidth pixels Specifies in pixels the width of the border around icons. The default is 2. IconDirectory string Specifies the directory that should be searched if a bitmap file cannot be found in any of the direc- tories in the bitmapFilePath resource. IconFont string Specifies the font to be used to display icon names within icons. The default is variable. IconForeground string [{ window-list }] Specifies the foreground color to be used when displaying icons and may only be specified inside of a Color or Monochrome list. The optional window list is a list of window names and colors so that per-window colors may be specified. See the discus- sion of the BorderColor variable earlier in this section for a complete description of window-list. The default is black. IconifyByUnmapping [{ window-list }] Indicates that windows should be iconified by being unmapped without trying to map any icons. This as- sumes that the user will remap the window through the icon manager, the f.warpto function, or the TwmWindows menu. If the optional window list is given, only those windows are iconified by simply unmapping. Windows that have both this variable and the IconManagerDontShow variable set may not be ac- cessible if no binding to the TwmWindows menu is set in the user's startup script. IconManagerBackground string [{ window-list }] Specifies the background color to use for icon manager entries, and may only be specified inside of a Color or Monochrome list. The optional window list is a list of window names and colors so that per-window colors may be specified. See the discus- sion of the BorderColor variable earlier in this section for a complete description of window-list. The default is white. November, 1990 9



twm(1X) twm(1X)
IconManagerDontShow [{ window-list }] Indicates that the icon manager should not display any windows. If the optional window list is given, only those windows are not displayed. This variable is used to prevent windows that are rarely iconified (such as xclock or xload) from taking up space in the icon manager. IconManagerFont string Specifies the font to be used when displaying icon manager entries. The default is variable. IconManagerForeground string [{ window-list }] Specifies the foreground color to be used when displaying icon manager entries and may only be specified inside of a Color or Monochrome list. The optional window list is a list of pairs of window names and colors so that per-window colors may be specified. See the discussion of the BorderColor variable earlier in this section for a complete description of window-list. The default is black. IconManagerGeometry string [ columns ] Specifies the geometry of the icon manager window. The string argument is standard geometry specifica- tion that indicates the initial full size of the icon manager window. The icon manager window is then broken into columns pieces and scaled according to the number of entries in the icon manager. Extra entries are wrapped to form additional rows. The default number of columns is 1. IconManagerHighlight string [{ window-list }] Specifies the border color to be used when highlighting the icon manager entry that currently has the focus, and can only be specified inside of a Color or Monochrome list. The optional window list is a list of pairs of window names and colors so that per- window colors may be specified. See the discussion of the BorderColor variable earlier in this section for a complete description of window-list. The de- fault is black. IconManagers { icon-manager-list } Specifies a list of icon managers to create. Each item in icon-manager-list has the following format: "window" ["icon"] "geometry" columns where window is the name of the window that should be put into this icon manager, icon is the name of 10 November, 1990



twm(1X) twm(1X)
that icon manager window's icon, geometry is a stan- dard 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 } An entry is created in the XTerm icon manager for a client whose name or class is XTerm. A client whose name is myhost is put into the myhost icon manager. IconManagerShow { window-list } Specifies a list of windows that should appear in the icon manager. When used in conjunction with the IconManagerDontShow variable, only the windows in this list are shown in the icon manager. IconRegion geometry vgrav hgrav grid-width grid-height Specifies an area on the root window in which icons are placed if no specific icon location is provided by the client application. The geometry is a quoted string containing a standard geometry specification. If more than one IconRegion line is given, icons are put into the succeeding icon areas when the previous is full. The vgrav argument should be North or South and is used to control whether icons are first filled in from the top or bottom of the icon region. Similarly, the hgrav argument should be East or West and is used to control whether icons should be filled in from the left or the right. Icons are laid out within the area in a grid with cells grid- width pixels wide and grid-height pixels high. Icons { window-list } Specifies a list of window names and the bitmap filenames that should be used as their icons, as in this example: Icons { "XTerm" "xterm.icon" "xfd" "xfd_icon" } Windows that match XTerm would not be iconified by unmapping and would try to use the icon bitmap in the file xterm.icon. If ForceIcons is specified, November, 1990 11



twm(1X) twm(1X)
this bitmap is be used even if the client requests its own icon pixel map. InterpolateMenuColors Indicates that menu item colors should be interpo- lated between colors specified for items. In the example below: 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 are in- terpolated between black and white, and the back- ground colors are interpolated between red and green. Similarly, the foreground for entry4 is halfway between white and red, and the background is halfway between green and white. MakeTitle { window-list } Specifies a list of windows on which a title bar should be placed. This variable is also used to re- quest titles on specific windows when NoTitle is set. MaxWindowSize string Specifies a geometry in which the width and height give the maximum size for a given window. This variable is typically used to restrict windows to the size of the screen. The default is 30000 x 30000. MenuBackground string Specifies the background color used for menus. This variable can only be specified inside of a Color or Monochrome list. The default is white. MenuFont string Specifies the font to use when displaying menus. The default is variable. MenuForeground string Specifies the foreground color used for menus. This variable can only be specified inside of a Color or Monochrome list. The default is black. 12 November, 1990



twm(1X) twm(1X)
MenuShadowColor string Specifies the color of the shadow behind pull-down menus. This variable can only be specified inside of a Color or Monochrome list. The default is black. MenuTitleBackground string Specifies the background color for f.title entries in menus. This variable can only be specified inside of a Color or Monochrome list. The default is white. MenuTitleForeground string Specifies the foreground color for f.title entries in menus. This variable can only be specified inside of a Color or Monochrome list. The default is black. Monochrome { colors } Specifies a list of color assignments that should be made if the screen has a depth of 1. See the description of Color earlier in this section. MoveDelta pixels Specifies the number of pixels the pointer must move before the f.move function starts working. See the discussion of the f.deltastop function in ``User- defined functions'' later in the ``Description'' section. The default is 0 pixels. NoBackingStore Indicates that twm should not request the X server to perform backing store for twm menus. Backing store is a service performed by the X server whereby the server saves the window contents in backing store and redraws the window from backing store when needed. The NoBackingStore is variable typically used with servers that can redraw the window contents faster than they can copy from backing store. NoCaseSensitive Indicates that case should be ignored when sorting icon names in an icon manager. This variable is typically used with applications that capitalize the first letter of their icon name. NoDefaults Indicates that twm should not supply the default ti- tle buttons and bindings. This variable should only be used if the startup script contains a completely new set of bindings and definitions. November, 1990 13



twm(1X) twm(1X)
NoGrabServer Indicates that twm should not grab the server when displaying pop-up menus and moving opaque windows. NoHighlight [{ window-list }] Indicates that borders should not be highlighted to track the location of the pointer. If the optional window list is given, highlighting is only disabled for the specified windows. When the border is highlighted, it is drawn in the current BorderColor. When the border is not highlighted, it is stippled with an gray pattern using the current Border- TileForeground and BorderTileBackground colors. NoIconManagers Indicates that no icon manager should be created. NoMenuShadows Indicates that menus should not have drop shadows drawn behind them. This variable is typically used with slower servers because it speeds up menu draw- ing at the expense of making the menu slightly hard- er to read. NoRaiseOnDeiconify Indicates that windows that are deiconified should not be raised. NoRaiseOnMove Indicates that windows should not be raised when moved. This variable is typically used to allow windows to slide underneath each other. NoRaiseOnResize Indicates that windows should not be raised when resized. This variable is typically used to allow windows to be resized underneath each other. NoRaiseOnWarp Indicates that windows should not be raised when the pointer is warped into them with the f.warpto func- tion. If this variable is set, warping to a hidden window may result in the pointer ending up in the occluding window instead the desired window, which causes unexpected behavior with f.warpring. NoSaveUnders Indicates that menus should not request save-unders to minimize window repainting following menu selec- tion. This variable is typically used with displays that can repaint faster than they can handle save- 14 November, 1990



twm(1X) twm(1X)
unders. NoStackMode [{ window-list }] Indicates that client window requests to change stacking order should be ignored. If the optional window list is given, only requests on the specified windows are ignored. This variable is typically used to prevent applications from relentlessly pop- ping themselves to the front of the window stack. NoTitle [{ window-list }] Indicates that windows should not have title bars. If the optional window list is given, only the specified windows do not have title bars. MakeTitle may be used with this variable to force title bars to be put on specific windows. NoTitleFocus Indicates that twm should not set keyboard input focus to each window as it is entered. Normally, twm sets the focus so that focus and key events from the title bar and icon managers are delivered to the application. If the pointer is moved quickly and twm is slow to respond, input can be directed to the old window instead of the new. This variable is typically used to prevent ``input lag'' and to work around problems in older applications that have trouble handling focus events. NoTitleHighlight [{ window-list }] Indicates that the highlight area of the title bar, which is used to indicate the window that currently has the input focus, should not be displayed. If the optional window list is given, only the speci- fied windows do not have highlight areas. This variable and SqueezeTitle can be set to substantial- ly reduce the amount of screen space required by ti- tle bars. OpaqueMove Indicates that the f.move function should actually move the window instead of just an outline so that the user can immediately see what the window will look like in the new position. This variable is typically used on fast displays, particularly if No- GrabServer is set. Pixmaps { pixmap-list } Specifies a list of pixel maps that define the ap- pearance of various images. Each entry is a keyword indicating the pixel map to set, followed by a string giving the name of the bitmap file. The fol- November, 1990 15



twm(1X) twm(1X)
lowing pixel maps may be specified: Pixmaps { TitleHighlight "gray1" } The default for TitleHighlight is to use an even stipple pattern. RandomPlacement Indicates that windows with no specified geometry should be placed in a pseudo-random location instead of having the user drag out an outline. ResizeFont string Specifies the font to be used when resizing windows. The default is fixed. RestartPreviousState Indicates that twm should attempt to use the WM_STATE property on client windows to tell which windows should be iconified and which should be left visible. This variable is typically used to regen- erate the state that the screen was in before the previous window manager was shut down. ShowIconManager Indicates that the icon manager window should be displayed when twm is started. It can always be brought up using the f.showiconmgr function. SortIconManager Indicates that entries in the icon manager should be sorted alphabetically rather than by simply append- ing new windows to the end. SqueezeTitle [{ squeeze-list }] Indicates that twm should attempt to use the SHAPE extension to make title bars occupy only as much screen space as they need, rather than extending all the way across the top of the window. The optional squeeze list may be used to control the location of the squeezed title bar along the top of the window. It contains entries of the form: "name" justification numerator denominator where name is a window name, justification is either left, center, or right, and numerator and denomina- tor are numbers specifying a ratio giving the rela- tive position about which the title bar is justi- 16 November, 1990



twm(1X) twm(1X)
fied. If the numerator is positive, the ratio is measured from left to right; if the numerator is negative, the ratio is measured from right to left. 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. Here is an example: SqueezeTitle { "XTerm" left 0 0 "xterm1" left 1 3 "xterm2" left 2 3 "oclock" center 0 0 "emacs" right 0 0 } The DontSqueezeTitle variable can be used to turn off squeezing on certain titles. StartIconified [{ window-list }] Indicates that client windows should initially be left as icons until explicitly deiconified by the user. If the optional window list is given, only the specified windows are started as iconified. This variable is useful for client applications that do not support an -iconic command-line option or resource. TitleBackground string [{ window-list }] Specifies the background color used in title bars. This variable may only be specified inside of a Color or Monochrome list. The optional window list is a list of window names and colors so that per- window colors may be specified. The default is white. TitleButtonBorderWidth pixels Specifies in pixels the width of the border sur- rounding title buttons. This variable is typically set to 0 to allow title buttons to take up as much space as possible and to not have a border. The de- fault is 1. TitleFont string Specifies the font to use for displaying window names in title bars. The default is variable. TitleForeground string [{ window-list }] Specifies the foreground color used in title bars. This variable may only be specified inside of a Color or Monochrome list. The optional window list November, 1990 17



twm(1X) twm(1X)
is a list of window names and colors so that per- window colors may be specified. The default is black. TitlePadding pixels Specifies the distance between the various icons, text, and highlight areas in the title bar. The de- fault is 8 pixels. UnknownIcon string Specifies the filename of a bitmap file to be used as the default icon. This bitmap is used as the icon of all clients that do not provide an icon bit- map and are not listed in the Icons list. UsePPosition string Specifies whether twm should honor client-requested locations (given by the PPosition flag in the WM_NORMAL_HINTS property) in the absence of a user- specified position. The argument string may have one of three values: "off" (the default) indicating that twm should ignore the client-supplied position, "on" indicating that the position should be used, and "non-zero" indicating that the position should used if it is other than (0,0). The latter option is for working around a problem in older toolkits. WarpCursor [{ window-list }] Indicates that the pointer should be warped into windows when they are deiconified. If the optional window list is given, the pointer is only warped when those windows are deiconified. WindowRing { window-list } Specifies a list of windows along which the f.warpring function cycles. WarpUnmapped Indicates that the f.warpto function should deiconi- fy any iconified windows it encounters. This vari- able is typically used to make a key binding that pops a particular window no matter where it is. The default is for f.warpto to ignore iconified windows. XorValue number Specifies the value to use when drawing window out- lines for moving and resizing. This variable should be set to a value that results in a variety of dis- tinguishable colors when an exclusive-OR operation is performed with the contents of the user's typical screen. Setting this variable to 1 often gives nice results if adjacent colors in the default colormap 18 November, 1990



twm(1X) twm(1X)
are distinct. By default, twm causes temporary lines to appear at the opposite end of the colormap from the graphics. Zoom [ count ] Indicates that outlines suggesting movement of a window to and from its iconified state should be displayed whenever a window is iconified or deiconi- fied. The optional count specifies the number of outlines to be drawn. The default count is 8. 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: DefaultFunction function Specifies the function to be executed when a key or button event is received for which no binding is provided. This is typically bound to f.nop, f.beep, or a menu containing window operations. WindowFunction function Specifies the function to execute when a window is selected from the TwmWindows menu. If this variable is not set, the window is deiconified and raised. Bindings After the desired variables have been set, functions may be attached to title buttons, keys, and other buttons. Title buttons may be added from the left or right side and appear in the title bar from left to right according to the order in which they are specified. Bindings for keys and other buttons may be given in any order. Title button specifications must include the name of the pixel map to use and the function to be invoked when the pointer is on them and the mouse button (or the LEFT ARROW key or RIGHT ARROW key) is pressed. LeftTitleButton "bitmap" = function or RightTitleButton "bitmap" = function The string bitmap may refer to one of the built-in bitmaps (which are scaled to match TitleFont) by using the appropri- ate colon-prefixed name described in ``Variables.'' Specifications for keys and other buttons must give the modifiers that must be pressed, over which parts of the screen the pointer must be, and what function is to be in- November, 1990 19



twm(1X) twm(1X)
voked. Keys are given as strings containing the appropriate keysym name (see xmodmap(1X); buttons are given as the key- words Button1i through fCButton5: "FP1" = modlist : context : function Button1 = modlist : context : function The string modlist is any combination of the modifier names shift, control, lock, meta, mod1, mod2, mod3, mod4, or mod1 (which may be abbreviated as s, c, l, m, m1, m2, m3, m4, m5, respectively) separated by a vertical bar (|). Similarly, the string context is any combination of window, title, icon, root, frame, iconmgr, their first letters (iconmgr ab- breviation is m), or all, separated by a vertical bar. The string function is any of the f. keywords described later in ``User-defined Functions.'' For example, the default start- up script 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 wants 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 "xcalc" "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 User-defined functions The twm client application provides many more window- manipulation primitives than can be conveniently stored in a title bar, menu, or set of key bindings. Although a small set of defaults are supplied (unless NoDefaults is speci- fied), most users want to have their most common operations bound to keys and buttons. To do this, twm associates names 20 November, 1990



twm(1X) twm(1X)
with each of the primitives and provides user-defined func- tions for building higher-level primitives and menus for in- teractively 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 func- tions to execute, as in this 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 following descriptions, if the function is said to operate on the selected window but is invoked from a root menu, the cursor is changed to the Select cursor and the next window to receive a button press is chosen: ! string Acts as an abbreviation for f.exec string. f.autoraise Toggles whether or not the selected window is raised whenever entered by the pointer. See the descrip- tion of the AutoRaise variable in ``Variables'' ear- lier in the ``Description'' section. f.backiconmgr Warps the pointer to the previous column in the current icon manager, wrapping back to the previous row if necessary. f.beep Sounds the keyboard bell. f.bottomzoom Resizes the window to fill only the bottom half of the screen. This function is similar to the f.fullzoom function, but resizes the window to fill only the bottom half of the screen. f.circledown Lowers the topmost window that hides another window. f.circleup Raises the bottommost window that is hidden by another window. f.colormap string Rotates the colormaps (obtained from the November, 1990 21



twm(1X) twm(1X)
WM_COLORMAP_WINDOWS property on the window) that twm displays when the pointer is in this window. The argument string may have one of the following values: "next", "prev", and "default". f.deiconify Deiconifies the selected window. If the window is not an icon, this function does nothing. f.delete Sends the WM_DELETE_WINDOW message to the selected window if the client application requests it through the WM_PROTOCOLS window property. The application is supposed to respond to the message by removing the indicated window. If the window has not re- quested WM_DELETE_WINDOW messages, the keyboard bell is rung indicating that the user should choose an alternative method. f.deltastop Allows a user-defined function to be terminated if the pointer is moved more than MoveDelta pixels. See the example definition for Function "move-or-raise" at the beginning of this section. f.destroy Instructs the X server to close the display connec- tion of the client that created the selected window. This should only be used as a last resort for shut- ting down runaway clients. f.downiconmgr Warps the pointer to the next row in the current icon manger, wrapping to the beginning of the next column if necessary. f.exec string Passes the argument string to /bin/sh for execution. In multiscreen mode, if string starts a new X client without giving a display argument, the client ap- pears on the screen from which this function was in- voked. f.focus Toggles the keyboard focus of the server to the selected window, changing the focus rule from pointer-driven if necessary. If the selected window is already focused, this function executes an f.unfocus. f.forcemove Drags an outline of the selected window (or the win- 22 November, 1990



twm(1X) twm(1X)
dow itself if the OpaqueMove variable is set) until the mouse button is released. This function is similar to f.move except that it ignores the DontMoveOff variable. f.forwiconmgr Warps the pointer to the next column in the current icon manager, wrapping to the beginning of the next row if necessary. f.fullzoom Resizes the selected window to the full size of the display or restores the original size if the window is already zoomed. f.function string Executes the user-defined function whose name is specified by the argument string. f.hbzoom Resizes the window to fill only the bottom half of the screen. This function is a synonym for f.bottomzoom. f.hideiconmgr Unmaps the current icon manager. f.horizoom Resizes the selected window to the full width of the display. f.htzoom Resizes the selected window to the top half of the display. This function is a synonym for f.topzoom. f.hzoom Resizes the selected window to the full width of the display. This function is a synonym for f.horizoom. f.iconify Iconifies or deiconifies the selected window or icon, respectively. f.identify Displays a summary of the name and geometry of the selected window. Clicking the pointer or pressing a key in the window dismisses the summary. f.lefticonmgr Warps the pointer to the previous column in the current icon manager. This function is similar to f.backiconmgr except that wrapping does not change rows. November, 1990 23



twm(1X) twm(1X)
f.leftzoom Resizes the selected window to the left half of the display. f.lower Lowers the selected window. f.menu string Invokes the menu specified by the argument string. Cascaded menus may be built by nesting calls to f.menu. f.move Drags an outline of the selected window (or the win- dow itself if the OpaqueMove variable is set) until the mouse button is released. Clicking twice within the number of milliseconds given by ConstrainedMoveTime warps the pointer to the center of the window and constrains the move to be either horizontal or vertical depending on which grid line is crossed. To cancel a move, press the LEFT ARROW key or RIGHT ARROW key before releasing the mouse button. f.nexticonmgr Warps the pointer to the next icon manager contain- ing any windows on the current or any succeeding screen. f.nop Does nothing and is typically used with the DefaultFunction or WindowFunction variables or to introduce blank lines in menus. f.previconmgr Warps the pointer to the previous icon manager con- taining any windows on the current or preceding screens. f.quit Causes twm to restore the window's borders and exit. If twm is the first client invoked from xdm, this results in a server reset. f.raise Raises the selected window. f.raiselower Raises the selected window to the top of the stack- ing order if it is hidden by any windows, otherwise the window are lowered. f.refresh Causes all windows to be refreshed. f.resize Displays an outline of the selected window. Cross- 24 November, 1990



twm(1X) twm(1X)
ing a border (or setting AutoRelativeResize) causes the outline to begin to stretch until the mouse but- ton is released. To cancel a resize, press the LEFT ARROW key or RIGHT ARROW key before releasing the mouse button. f.restart Terminates and restarts twm. f.righticonmgr Warps the pointer to the next icon manager contain- ing any windows on the current or any succeeding screen. This function is similar to f.nexticonmgr except that wrapping does not changes rows. f.rightzoom Resizes the selected window to the right half of the display. f.saveyourself Sends a WM_SAVEYOURSELF message to the selected win- dow if it has requested the message in its WM_PROTOCOLS window property. Clients that accept this message are supposed to check all states asso- ciated with the window and update the WM_COMMAND property as specified in Inter-Client Communications Conventions Manual. If the selected window does not accept this message, the keyboard bell is rung. f.showiconmgr Maps the current icon manager. f.sorticonmgr Sorts the entries in the current icon manager alpha- betically. See the variable SortIconManager in ``Variables'' earlier in the ``Description'' sec- tion. f.title Provides a centered, unselectable item in a menu de- finition. This function should not be used in any other context. f.topzoom Resizes the selected window to the top half of the display. f.unfocus Resets the focus back to pointer-driven. This func- tion should be used when a focused window is no longer desired. f.upiconmgr November, 1990 25



twm(1X) twm(1X)
Warps the pointer to the previous row in the current icon manager, wrapping to the last row in the same column if necessary. f.vlzoom Resizes the selected window to the left half of the display. This function is a synonym for f.leftzoom. f.vrzoom Resizes the selected window to the right half of the display. This function is a synonym for f.rightzoom. f.warpring string Warps the pointer to the next or previous window (as indicated by the argument string, which may be "next" or "prev") specified in the WindowRing vari- able. f.warpto string Warps the pointer to the window that has a name or class that matches string. If the window is iconi- fied, it is deiconified if the variable WarpUnmapped is set or else ignored. f.warptoiconmgr string Warps the pointer to the icon manager entry associ- ated with the window containing the pointer in the icon manager specified by the argument string. If string is "", the current icon manager is chosen. f.warptoscreen string Warps the pointer to the screen specified by string. The string may be a number, such as "0" or "1", the word "next" (indicating the current screen plus 1, skipping over any unmanaged screens), the word "back" (indicating the current screen minus 1, skip- ping over any unmanaged screens), or the word "prev" (indicating the last screen visited). f.winrefresh Refreshes only the selected window. f.zoom Similar to the f.fullzoom function, except that the only the height of the selected window is changed. Menus Functions may be grouped and interactively selected using pop-up (when bound to a pointer button) or pull-down (when associated with a title button) menus. Each menu specifica- tion contains the name of the menu as it will be referred to by f.menu, optional default foreground and background 26 November, 1990



twm(1X) twm(1X)
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 string 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, including the menu title and any menu items. The string portion of each menu entry is the text that appears 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 are only 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 that contains the names of all of the client and twm-supplied windows. Selecting an entry causes the WindowFunction variable to be executed on that window. If WindowFunction isn't set, the window is deiconified and raised. Icons The twm manager supports several different ways of manipu- lating iconified windows. The common pixel-map-and-text style may be laid out by hand or automatically arranged as described by the IconRegion variable. In addition, a terse grid of icon names, called an icon manager, provides a more efficient use of screen space as well as the ability to na- vigate among windows from the keyboard. An icon manager is a window that contains names of selected windows or all windows currently on the display. In addi- tion to the window name, a small icon using the default iconify symbol is 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 iconmgr context when specifying button and keyboard bindings. November, 1990 27



twm(1X) twm(1X)
Moving the pointer into the icon manager also directs key- board focus to the indicated window by setting the focus ex- plicitly or by sending synthetic events. The NoTitleFocus variable 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. Environment variables The twm command uses the following environment variables: DISPLAY Specifies the default host, display number, and screen. This variable is set during f.exec so that client applications come up on the proper screen. HOME Specifies the absolute pathname of the user's home directory and is used as the prefix for files that begin with a tilde (~) and for locating the twm startup script. LIMITATIONS The resource manager should have been used instead of all the window lists. The IconRegion variable should take a list. Double-clicking very fast to get the constrained move func- tion sometimes causes the window to move, even though the pointer is not moved. If IconifyByUnmapping is on and windows are listed in Icon- ManagerDontShow but not in DontIconifyByUnmapping, they may be lost if they are iconi- fied and no bindings to f.menu "TwmWindows" or f.warpto are set up. NOTES Portions copyright 1988, Evans & Sutherland Computer Cor- poration; portions copyright 1989, Hewlett-Packard Company and the Massachusetts Institute of Technology. See X(1X) for a full statement of rights and permissions. Authors: Tom LaStrange, Solbourne Computer; Jim Fulton, MIT X Consortium; Steve Pitschke, Stardent Computer; Keith Packard, MIT X Consortium; and Dave Payne, Apple Computer FILES $HOME/.twmrc.<number> Specifies a per-screen startup script for twm. $HOME/.twmrc Specifies an individual user's startup script if no per-screen startup script can be found. 28 November, 1990



twm(1X) twm(1X)
/usr/lib/X11/twm/system.twmrc Specifies a system-wide default configuration that is used when no other startup script can be found. SEE ALSO X(1X), xdm(1X), XmacII(1X), xmodmap(1X), xrdb(1X) Inter-Client Communications Conventions Manual November, 1990 29

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026