twm - a window manager for X11 (Tom's Window Manager)
twm [-display display]
The twm program is a window manager client application of the window server.
The twm program was written to try and incorporate some of the desirable features of both the wm and uwm window managers. Twm puts a title bar on and re-parents each window. The title bar contains the window's name and three "buttons". When a pointer button press event is detected in any of these title bar "buttons" a certain action is performed. The left-most title bar button that looks like a window pane causes the window to be iconified. The right-most title bar button with the right-angles is the re-size button. The resize function is identical to the window resize function of the wm window manager. The other title bar button is supposed to represent a keyboard, a button click here causes the input focus to be directed to this window until the f.focus function is executed or another window is selected to get input focus. The title bar has the additional feature of becoming highlighted if the window has the input focus.
When twm is invoked, it attempts to read a twm startup file. The name of the twm startup file is:
$HOME/.twmrc
The twm startup file can be thought of as having three logical sections: the variables section, the buttons section, and the menus section. The variables section must come first, followed by either the buttons section or the menus section.
All variables and keywords may be entered in any combination of upper and lower case letters. Title functions and Root functions must be entered in lower case. A pound sign (#) character in the startup file indicates a comment which is terminated by the newline character. A string in the startup file is a series of characters enclosed by double quotes.
Variables must be entered first, at the top of the startup file. Variables are initialized once when twm begins execution, they will not be effected when a f.twmrc function is executed.
AutoRaise { "xterm" "xclock" }
The above list contains two names which will match window names beginning with the string "xterm" or "xclock". The following window names will match and be in auto-raise mode: "xterm", "xterm_iguana", "xclock".
The buttons section of the startup file contains definitions of functions to perform when pointer buttons are pressed. There are two classes of functions that can be tied to a pointer button: Title functions, which will be executed if a pointer button is pressed while the pointer is in the title bar of a window; and Root functions, which will be executed while the pointer is in the root window or if the client program is not processing pointer button events.
Title functions are assigned as follows:
The defaults for title functions are as follows:
Root functions are assigned either to a pointer button or a menu entry. The f.title function is the only one that doesn't really make sense to use as just a button function. It was designed to be used in a pull-down menu. Root functions are assigned to pointer buttons as follows:
The menus section is where pull-down menus are defined. Entries in menus consist of Root functions as described in the Buttons Section. The syntax to define a menu is:
Menu "menu name" { string function string function . . string function }
The menu name should be an identical string to one being used with an f.menu Root function. Note that the menu name is case sensative. The string portion of each menu entry will be the text which will appear in the menu. The function portion of the menu entry is one of the Root functions described in the previous section.
Since the X11 xterm does not provide an icon, twm can provide a reasonable looking one for you. When twm is framing a window it looks at the name of the window to determine if it should add an appropriate icon for xterm windows. The names it looks for are:
xterm yterm console login
If twm finds any of the above names as the first part of the window name, the twm xterm icon bitmap is assigned as the bitmap to display when the window is iconified.
If the window name begins with the string "xterm_", only the portion of the name following the "xterm_" will be displayed as the window name in the title bar. For example: an xterm started with "-T xterm_iguana" would display the name "iguana" in the title bar.
The following is an example twm startup file:
#********************************************************************** # # .twmrc # #********************************************************************** WarpCursor UnknownIcon "/usr/ias_soft/tlastrange/.icon" BorderWidth 2 TitleFont "8x13" MenuFont "8x13" IconFont "8x13" Button1 f.menu "button1" Button2 f.menu "button2" Button3 f.menu "button3" Button4 f.nop Button5 f.nop TitleButton1 t.raise TitleButton2 t.move TitleButton3 t.lower TitleButton4 t.nop TitleButton5 t.nop AutoRaise { "xterm" # all of my xterm windows will auto-raise } NoTitle { "xclock" # don't need a title bar on this ... "xckmail" # or this } menu "button1" { "Sun Systems" f.title "iguana" !"xterm -T xterm_iguana =80x24+100+100 -e rlogin iguana &" "worm" !"xterm -T xterm_worm =80x24+100+100 &" "shiva" !"xterm -T xterm_shiva =80x24+200+200 -e rlogin shiva &" "tegus" !"xterm -T xterm_tegus =80x24+200+200 -e rlogin tegus &" "Vax Systems" f.title "shade" !"xterm -T xterm_shade =80x24+200+200 -e rlogin shade &" "bilbo" !"xterm -T xterm_bilbo =80x24+250+250 -e rlogin bilbo &" "frodo" !"xterm -T xterm_frodo =80x24+300+300 -e rlogin frodo &" "esunix" !"xterm -T xterm_esunix =80x24+350+350 -e rlogin esunix &" "lynx8" !"xterm -T xterm_lynx8 =80x24+390+390 -e rlogin lynx8 &" } menu "button2" { "Window Ops" f.title "Refresh" f.refresh "Focus on Root" f.focus "Source .twmrc" f.twmrc "Source something" f.source "something" "twm Version" f.version } menu "button3" { "Cut Buffer" f.title "Procedure Header" f.file "/usr/ias_soft/tlastrange/src/proc.twm" "File Header" f.file "/usr/ias_soft/tlastrange/src/file.twm" "pull right" f.menu "blob" } menu "blob" { "pull right" f.menu "final" "another" ^"some text" } menu "final" { "entry 1" f.nop "entry 2" f.nop "entry 3" f.nop "entry 4" f.nop }
Twm needs to deal with color displays at some point. Only monochrome is currently supported.
Pull-right menus may still have some problems. They may sometimes stay around when all pointer buttons have been released.
Double clicking very fast to get the constrained move function will sometimes cause the window to move, even though the pointer is not moved.
$HOME/.twmrc
THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY EVANS & SUTHERLAND. EVANS & SUTHERLAND MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY 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 the copyright notice and this permission notice appear in supporting documentation, and that the name of Evans & Sutherland not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.