1 tvtwm - Tom's Virtual Tab Window Manager
2 patchlevel 11
3 Chris P. Ross
4 cross@va.pubnix.com
5 9 February, 1995
6
7PERSONAL NOTE:
8
9 Since the last release, I've changed jobs. I now work for Pubnix, a
10tiny little division of UUNET Technologies, Inc. This change has caused
11some delay in releasing tvtwm, but then again, I didn't get it released
12all that often before. So...
13
14 A high point of this is that I'm now working on BSDI boxes, so I had
15the chance to fix the various problems tvtwm had with x86 BSD boxes. It
16should work much better on such boxes now...
17
18INTRODUCTION:
19
20 Hi. This is tvtwm. I'll assume that most of you know what tvtwm is
21already, but, for those of you who don't, let me explain. No, there is
22too much. Let me sum up.
23
24 tvtwm is a superset of the X11R5 release of twm (Tom's Window Manager),
25written by Tom LaStrange. Much of the early functionality, which is
26described in more detail in README.old, was added by Tom LaStrange himself.
27Since then, tvtwm has fallen under my control, and I've added some things
28myself.
29
30 Why doesn't tvtwm have version numbers, and only has patchlevels? I
31don't know. History, I suppose. But, for information's sake, that is
32effectually the version number. In this case, pl11.
33
34 The major benefit of tvtwm over twm is the "Virtual Desktop". This
35allows you do define a substitute root window that is larger than your
36display area. This new virtual root window is the parent for all of your
37X clients. tvtwm provides a "Panner" which will let you see a scaled down
38representation of the whole virtual desktop. Using this panner, and keys
39bound to functions added to tvtwm, you can move around this desktop to
40have your physical display showing only part of the whole desktop. Thus,
41you can have sections of your desktop assigned to particular tasks, or
42just use it to keep from having 20 million layers of windows. :-)
43
44 Many other things are discussed in README.old. Please look there for
45further information. The more recent changes have been documented on an
46item-by-item basis, and these changes can be found, not surprisingly, in
47the CHANGES file.
48
49QUICK NOTES:
50
51 This version (pl11) of tvtwm is based on the X11R5 twm code. The X11R6
52version of twm implements a few new features, but other than that, no
53significant changes. So, these features will likely be added to tvtwm in
54the future, but I was not able to get them included for the X11R6 contrib
55deadline. There are, however, some changes to the code reflecting items
56from the X11R6 twm. I have added them as I've seen the need, and will
57continue to do so.
58
59 This version of tvtwm is dependent on the Xpm library. This library
60can be obtained from the normal X contrib sites. I have tested it with
61the version 3.4b most recently, but only minor extensions have been added
62since then, and I don't use any of them. But, the base functionality
63hasn't changed, so tvtwm should work just fine with the newer versions,
64as well.
65
66BUILD INSTRUCTIONS:
67
68 1) If you would like to do so, configure the Imakefile for your
69specific sites. The only things that are designed to be configurable
70are whether m4 will be run on the twmrc file by default, and whether
71or not your machine has a (working) waitpid() call.
72 If you wish to have m4 used by default, and do have a working
73waitpid() call, then you can skip configuring the Imakefile.
74 Also, if you wish to configure the installation procedure so that
75tvtwm installs a link to itself as twm, uncomment the appropriate
76section of the Imakefile...
77
78 2) Type 'xmkmf' to build yourself a Makefile.
79
80 3) Type 'make depend' to build dependencies in the Makefile.
81
82 4) Type 'make' to build tvtwm and ssetroot.
83
84 5) 'make install' should install the binaries.
85
86 If you have any problems, please contact me at cross@va.pubnix.com and
87I will try to help you with the problem...
88
89OTHER INFORMATION:
90
91 Where do I get the newest version of tvtwm?
92
93 I will try to keep the copy on ftp.x.org up to date, but the
94primary place where new version will be available is ftp.eng.umd.edu
95in /pub/tvtwm. Please, however, try the standard ftp.x.org mirrors
96near your site first.
97 At some point in the future, I'm likely to move the "primary"
98location from ftp.eng.umd.edu to a machine here, at my new job. But,
99for now, I'll keep ftp.eng.umd.edu up to date...
100
101 What machines does tvtwm work on?
102
103 I, unfortunately, have had very little opportunity to test tvtwm
104against an X11R6 installation on many machines. But, I have tested it
105under X11R5 under machines including:
106
107 Sun 3 and 4, SunOS 4.1.1 and 4.1.3
108 Sun Sparc, SunOS 2.1
109 DECstation 3100 and 5000, Ultrix 4.2b
110 DEC Alpha, OSF/1 v1.2 & v1.3
111 HP9000s700, HP/UX A09.01
112 x86, BSD 1.1 & 2.0 (beta)
113
114 In general, it should work on many systems, but I have not yet had
115the opportunity to test problems reported on AIX. If anyone has a box
116with MIT X11 install on it that I can use for testing, I would be very
117appreciative.
118
119 I did, however, manage to fix the bug that caused the m4 code to fail
120on x86 BSD's. Also, I was able to fix (or, implement a work-around) for
121the flex problem, as well.
122
123BUGS:
124
125 In a rewrite of the window move code, ConstrainedMove was desupported.
126I'm not going to change any of the documentation, as I do wish to
127re-support this. But, for the moment, it's a known bug. (I only got one
128report of it in the year and a half it's been missing. So, it can't hurt
129too much)
130
131 - Chris
132
133--
134Chris P. Ross Pubnix (a tiny little division
135cross@va.pubnix.com of UUNET technologies, Inc.)
136cross@uu.net Work#: (703)/206-5750
137
138
1
2 Welcome to tvtwm. This code is a derivation off of MIT's X11 twm
3program. For those of your who are used to twm, this should be an
4easy transition, that has *much* to offer you. This README file
5will mainly outline the differences between tvtwm, and other
6windows managers. As well as a detail about what makes this release
7different from past releases of tvtwm.
8
9 The first section below, was written by Tom LaStrange, the author
10of this code as I first started with it. The section below his, is
11a list and decription of the changes that have been made to tvtwm
12since I've been hacking on it.
13
14 - Chris Ross
15 cross@eng.umd.edu
16
17
18For those of you like me who want to try software before reading
19the instructions, all you have to do to get started is add a single
20line to your .twmrc file. Something like this:
21
22 VirtualDesktop "3000x2000"
23
24Now for the verbose description:
25
26This is yet another, different implementation of the Virtual Desktop
27concept for twm. I call this version tvtwm (Tom's Virtual twm). It is
28based on the R4 version of twm with up to fix-14 installed. This
29implementation is modeled after swm (Solbourne Window Manager) and
30includes the very nice ability to move windows into and out of the
31panner. It should be noted that none of this code came from the vtwm
32implementation. If you have problems and/or patches you can email me
33at the address at the end of this file.
34
35If we look at different implementations of the Virtual Desktop, I think
36we can relate them to soft drinks:
37
38swm - Classic Coke "The Real Thing"
39tvtwm - Diet Coke "Same as Coke but not as sweet"
40vtwm - Diet Pepsi "Not as sweet as Coke, some people may
41 prefer it to any flavor of Coke"
42
43There are pros and cons to the vtwm and swm/tvtwm implementations. Most
44revolve around whether or not to use an additional window for the
45scrolling desktop or to simply move windows around on the actual
46root window.
47
48vtwm moves windows on the actual root window, swm/tvtwm use an
49additional window to perform the scrolling.
50
51Pros:
52 vtwm Simple to implement.
53 Programs like xsetroot continue to work.
54
55 tvtwm Half the network traffic when the desktop scrolls,
56 only a ConfigureNotify event has to be sent.
57 Faster scrolling of the desktop.
58 Desktop background image will actually scroll.
59 Opens the door for possible multiple Virtual Desktop
60 windows.
61Cons:
62 vtwm Twice as much network traffic when the desktop scrolls,
63 each window has to be moved and then a ConfigureNotify
64 event must be sent.
65 Slower scrolling of the desktop.
66 Desktop background image does not scroll.
67
68 tvtwm Programs like xsetroot no longer work, additional work
69 needs to be done to find the Virtual Desktop window.
70 Programs that attempt to find the size of the window
71 manager decoration may fail if the traverse the window
72 tree until they run into the actual root window.
73
74The ICCCM states that more work needs to be done in the area of
75virtual root windows, so there isn't any clear answer on the right
76way to implement this feature. Having said that, let me describe
77how I've butchered the code, what currently doesn't work, what would
78be nice if it worked, etc.
79
801. First a description of how the panner works. Basically,
81 mouse button 1 allows you to change your position in the
82 desktop. Mouse button 2 allows you to drag any of the
83 small "virtual" windows. During a window move operation
84 you can move the pointer into and out of the panner.
85 Resizing the panner will of course resize the desktop.
86
872. I completely re-wrote the window move code. In menus.c I
88 simply commented out the window move code that is there and
89 didn't touch any code related to window moves in events.c.
90 The new window move code is in a new file called move.c.
91
923. Rather than the f.nail and "NailedDown" features of vtwm, tvtwm
93 uses the same terminology as swm. In tvtwm, windows that do
94 not move when the desktop is panned are called "sticky" windows.
95 There is a command called f.stick and a "Sticky" list of windows
96 that will be sticky when started. Sticky windows used to always
97 be physically above non-sticky windows. This is no longer the case
98 but if you have gotten used to it, you can place the "StickyAbove"
99 keyword in your .{tv}twmrc file. The sticky-ness of a window is
100 remembered during an f.restart if RestartPreviousState is set.
101
1024. USPosition vs. PPosition - When a window has USPosition hints
103 set, the window will be positioned at that exact pixel location.
104 When PPosition hints are set, the window will be positioned at
105 the pixel location plus the current offset of the Virtual Desktop.
106 For example, if the desktop has been panned to +200+500 and
107 a window is mapped with PPosition +100+100, the window will be
108 positioned at +300+600 on the desktop.
109
1105. How does the icon gravity stuff work in relation to different areas
111 of the Virtual Desktop? I don't know, and I don't really have the
112 time to look into the problem. It might be nice to have separate icon
113 regions in different quadrants of the Virtual Desktop. If you use
114 icon managers and make them sticky then you don't have any problems.
115
1166. The initialization files .tvtwmrc.<screen number> and .tvtwmrc will
117 be attempted before .twmrc.<screen number> .twmrc.
118
119
120New Variables:
121
122VirtualDesktop "WIDTHxHEIGHT"
123 This variable simply specified the initial size of the Virtual Desktop.
124 Specifying this variable enables the Virtual Desktop feature.
125 Why didn't I use the same syntax as vtwm and also specify the panner
126 scale and geometry? I don't know, lazy I guess.
127
128VirtualDesktopBackgroundPixmap "filename"
129 The pixmap image to display as the background of the Virtual Desktop window.
130
131VirtualDesktopBackground "color"
132 The background color of the VirtualDesktop window. If
133 VirtualDesktopBackgroundPixmap is not set, the VirtualDesktop will have a
134 solid background of this color.
135
136VirtualDesktopForeground "color"
137 This color is only used if VirtualDesktopBackgroundPixmap is set.
138
139VirtualForeground "color" [ { window list } ]
140 Specifies the foreground color for the small virtual panner windows.
141
142VirtualBackground "color" [ { window list } ]
143 Specifies the background color for the small virtual panner windows.
144
145VirtualFont "5x8"
146 The font to use when ShowVirtualNames is specified.
147
148ShowVirtualNames
149 This causes the window name to be displayed in the small virtual
150 panner window. The VirtualFont is used to display the name.
151
152PannerGeometry "+-X+-Y"
153 Specifies the geometry at which the panner is to be placed. The
154 default is "-0-0".
155
156PannerState "state"
157 This specifies the initial state of the panner. Possible values
158 include "withdrawn", "iconic", and "normal". The default state
159 is "normal".
160
161PannerScale scale
162 This specifies the scale of the panner. The default number is 20.
163
164PannerBackgroundPixmap "filename"
165 The pixmap image to display as the background of the panner window.
166
167PannerBackground "color"
168 The background color of the panner window. If PannerBackgroundPixmap
169 is not set, the panner will have a solid background of this color.
170
171PannerForeground "color"
172 This color is only used if PannerBackgroundPixmap is set.
173
174ScrollDistanceX percentage
175ScrollDistanceY percentage
176 The percentage of the display width/height to move for the f.scroll
177 commands
178
179Sticky { window list }
180 A list of windows that will come up in a sticky state.
181
182StickyAbove
183 Causes sticky windows to always be physically above non-sticky windows.
184
185NoIconTitle [ { window list } ]
186 Specifies that no titles should be displayed below icons. If the
187 optional window list is present then only those clients will
188 not have icon titles.
189
190IconTitle { window list }
191 Specifies a list of clients that will have icon titles. Useful
192 when NoIconTitle has been specified alone.
193
194New Commands:
195
196f.panner - toggle making the panner visible
197f.scroll "position" - scroll to a specific position
198f.scrollhome - scroll the desktop to 0,0
199f.scrollup - scroll the desktop up ScrollDistanceY
200f.scrolldown - scroll the desktop down ScrollDistanceY
201f.scrollleft - scroll the desktop left ScrollDistanceX
202f.scrollright - scroll the desktop right ScrollDistanceX
203f.scrollback - scroll back to the previous location
204f.panup - same as f.scrollup
205f.pandown - same as f.scrolldown
206f.panleft - same as f.scrollleft
207f.panright - same as f.scrollright
208f.stick - toggle making a window sticky or not
209
210
211A version of xsetroot, called ssetroot has been included as an
212example of how to find the Virtual Desktop window.
213
214--
215Tom LaStrange
216Solbourne Computer Inc. ARPA: toml@Solbourne.COM
2171900 Pike Rd. UUCP: ...!{boulder,sun}!stan!toml
218Longmont, CO 80501
219
220--------------------------------------------------------------------
221
222
223Things not added by Tom, bugs in them aren't his fault:
224
225Shaped Icons:
226
227 There are two implementations of icon shaping in this release of tvtwm.
228I will explain them both in this section, though the second is *much*
229easier to comprehend, and I advise ignoring the first icon-shaping
230description. Though both are active in the code, and functional, the
231existence of the built-in shaping in Xpm format pixmaps makes that
232the obviously simpler way to do things. I have added this code, so that
233Xpm format pixmaps with built-in shape masks work, but have yet to remove
234the old code for shaped icons, as described in the next paragraph.
235 *** Important!! ***
236 I *do* intend to remove this code. You can, if you want, utilize this
237form of icon-shaping, but later releases of tvtwm will likely not continue
238to support it.
239
240(Old, 3-bitmap, method):
241 Shaped icons have 3 parts, one of which is optional. The first part is
242the image. It is a normal icon, so you can use any of the ones you had all
243along. The second part is the clip. tvtwm will look for a file of the
244format "<filename>clp" where <filename> is the name of the bitmap to be
245used as an icon. A file followed by "clp" is a clip file for that icon.
246In this file, if a pixel is "on", the pixels in the image will be taken;
247and where the pixel is "off", the pixels from the mask (described below)
248will be placed. The third and optional part is the mask. Masks are
249searched for in the bitmapFilePath, as are the clip files, and are found by
250the iconname plus "msk". Pixels set to "on" in the mask and "off" in the
251clip are drawn in the IconBorderColor, pixels set to "off" in the mask and
252"on" in the clip are "holes" (whatever is under the icon will show through,
253and button presses there will go to the window under the icon (normally the
254root window)). The setting of a mask pixel where that clip pixel is "on"
255is ignored. If you don't give a mask, one will be created for temporary
256use. The mask that tvtwm creates will be two pixels wider then the clip
257(i.e. a two pixel border). It is often easier to let tvtwm generate the
258mask file, but that is up to your personal preference, and to the specific
259icon in question. All 3 parts must be bitmaps of the same height and width
260(even if the mask is automagicly created, it will not be created larger
261then the other two parts).
262
263(New, better, shaped Xpm method):
264 The current version of the Xpm library supports built-in shape masks.
265For a detailed description of how XPM works, please look at the
266documentation provided with Xpm. Xpm should be available in it's current
267form (which is required for this release of tvtwm. Version 3.0 (4-Oct-91)
268or higher.) on the R5 contrib tape, or if it's not, it can be obtained at
269either export.lcs.mit.edu or avahi.inria.fr. To detail how to use Xpm's
270built in shaping support, I will tell you the little you need to know in
271particular. If you have an xpm format pixmap file in a directory which is
272in your *bitmapFilePath X resource, then you can simply load the pixmap as
273"filename", just as you are used to doing with Xbm format bitmaps. If the
274file you specify can be found, and is a valid Xpm format file, then it will
275be read. If you have pixels in the pixmap defined as color "None", then a
276shape mask will be returned by the Xpm read functions, and tvtwm will use
277such a returned mask as an icon shape-mask. The result of which, is shaped
278icons. I will provide a few Xpm format icons in the icons/ directory. If
279you simply move one or more of these files into a directory which is an
280element of your *bitmapFilePath, then specify them as icons in your .twmrc
281file, you can see for yourself how they work. Also, I will include a
282couple sample titlebar button Xpm pixmaps. These are all pixmaps which I
283use regularly, and have grown fond of. I hope you find them as enjoyable.
284
285M4:
286
287 Your .twmrc file is fed to m4 before being parsed by tvtwm. Taking this
288approach to configuration is useful for keeping centrally maintained menus,
289making your setup work regardless of variables such as display size, and
290(though not at the moment) controlling who sees what of the .twmrc setup
291files. To help you make use of m4, and to give you something to program
292around, the following symbols are defined by tvtwm:
293
294 SERVERHOST, CLIENTHOST, HOSTNAME, USER, HOME, VERSION, REVISION,
295 VENDOR, RELEASE, WIDTH, HEIGHT, X_RESOLUTION, Y_RESOLUTION,
296 PLANES, BITS_PER_RGB, TWM_TYPE, CLASS, and COLOR.
297
298 For detailed explanations of what each of the above declarations is
299useful for, and what they are set to, look under M4 PREPROCESSING in the
300man page.
301
302Useful tricks with M4:
303
304# Use different pictures on color and black & white screen:
305ifelse(PLANES, 1, `
306VirtualDesktopBackgroundPixmap "/homes/elves/lib/rasters/space.rast"
307PannerBackgroundPixmap "/homes/elves/lib/rasters/space2.xbm"',
308`VirtualDesktopBackgroundPixmap "/homes/elves/lib/rasters/space.color.gif"
309PannerBackgroundPixmap "/homes/elves/lib/rasters/space2.xpm"')
310
311# Centrally maintained menus:
312include(/local/skel/X/twm-logins)
313
314# Place icons on the lower half and right third of the screen:
315define(IRegion, translit(eval(WIDTH/3)*eval(HEIGHT/2)+eval(WIDTH-WIDTH/3)-0, *, x))
316IconRegion "IRegion" SOUTH EAST 75 25
317
318# Create menus on the fly (possibly dependent on machine, lab, or arch):
319define(`TMPFILE', maketemp(`/tmp/twigm4XXXXXX'))
320syscmd(`sh /local/software/bin/twig.twm.sh >' TMPFILE)
321menu "Automagic"
322{
323"Magic" ("ivory1":"ivory4") f.title
324include(TMPFILE)
325syscmd(`rm' TMPFILE)
326}
327
328# Capitalize host name for use in window titles:
329define(LOWER_CASE,abcdefghijklmnopqrstuvwxyz)
330define(UPPER_CASE,ABCDEFGHIJKLMNOPQRSTUVWXYZ)
331"New Window" !"xterm -geometry 80x24 -T 'translit(substr(SERV
332ERHOST,0,1),LOWER_CASE,UPPER_CASE)`'substr(SERVERHOST,1)' &"
333
334
335XPM Support:
336
337 This version of tvtwm has support for X Pixmaps. By using X Pixmaps, you
338can get multi-color (meaning more than just the foreground and background
339colors. I personally have some 16 or 32 color icons now...) icons,
340titlebar buttons, and panner backgrounds. This code is conditional. If
341you simply comment out the two lines in the Imakefile which set the -DXPM
342and the location for the Xpm library, it will compile cleanly without
343support for Xpm's. To get this support, you must have the header file and
344library for Xpm. This release of tvtwm needs Xpm v3.0 (4-Oct-91) or
345higher, which can be found on the R5 contrib tape, or can be obtained via
346anonymous ftp from export.lcs.mit.edu or avahi.inria.fr. Once you have
347this installed on you system, you can use the Xpm code. When running tvtwm
348with Xpm support, tvtwm will search along bitmapFilePath (defined in your
349.Xdefaults) for Xpm pixmaps. (Note: tvtwm will *not* load Xpm version 1
350pixmaps, or version 2 pixmaps other than C format. What the Xpm library
351will and won't load is not up to me, and may change. I suggest trying to
352use strictly XPM v3 format pixmaps. If you have other versions, there are
353converter scripts available.) When it finds a bitmap/pixmap with the
354correct file name, it will try to load it as an Xpm. If this fails, it
355will attempt to load the same file as a standard bitmap. So, you can keep
356bitmaps and they will work just as well as they have in previous versions
357of tvtwm, but if you choose to, you can switch them to pixmaps. Both will
358work. As is, it does a fairly good job of falling back to reading it as an
359xbm file.
360
361 Right now, tvtwm is modified to use either pixmaps or bitmaps for icons,
362titlebar menu buttons, or the background of the panner window. And,
363actually, there is Xpm code for loading the VirtualDesktopBackgroundPixmap,
364too, but assuming you use the XLOADIMAGE def (explained below), I don't
365think you'll ever care that the Xpm code is there. It will only get
366compiled if notdef XLOADIMAGE. In theory, there could be code added to
367display pixmaps in other places as well, but we didn't see anything else
368that needed it. I hope to be adding it to the pullright pixmap soon, and
369maybe in a couple of the built-in pixmaps, but I'm not sure there is reason
370for it. If anyone has any suggestions, please feel free to mail me and let
371me know.
372
373Xloadimage for desktop background:
374
375 I have modified tvtwm slightly so that if you choose to compile it to do
376so (which I recomment heartily), it will fork() and exec() the xloadimage
377program (written by Jim Frost <jimf@saber.com>). Tvtwm creates a
378"virtual" root window over top of the real root window, and the will load a
379bitmap onto it automatically. With this modification, you can now specify
380VirtualDesktopBackgroundPixmap to be an image of nearly any format. Any
381format that xloadimage supports. xloadimage can load gif's, rasterfiles,
382xbm's, and many other common graphic types. This makes it much easier to
383load a colorful or large file, and have it be stored in the smallest
384possible format, as xloadimage also knows how to load compressed (.Z)
385files.
386
387 xloadimage is available from export.lcs.mit.edu and most other common ftp
388sites. It may well be on the R5 contrib tape, but I am not sure of this.
389
390 Side note: With tvtwm createing it's "virtual" root window, many
391programs that try to look for the root window (editres, xwd, xsetroot) will
392not work as expected. To fix many of these problems, there is a vroot.h
393header file that has been made available by Andreas Stolcke
394<stolcke@ICSI.Berkeley.EDU>, which redefines all of the standard X macros
395for the root window (RootWindow(), RootWindowOfScreen(), and
396DefaultRootWindow()). Most programs can be fixed by including the header
397file after Xlib.h in the source code. As for xsetroot, there is a program
398named ssetroot which is included with this distribution which is a complete
399superset of xsetroot. If you would like to do so, you can uncomment the
400line in the Imakefile that instructs the make to install this program over
401top of your xsetroot program. In most cases, this is advised. There is
402little or no reason to keep both copies.
403
404New Functions:
405
406 In this version of tvtwm, there are also a few extra functions. Most
407of these are simply override options, to perform a function without
408having to explicitly ask for it. For example, if you want to assign
409a button to perform an opaque move, even if OpaqueMove isn't set, then
410you can bind that button to f.opaquemove, instead of f.move. The new
411functions are as follows:
412
413 f.constrainedmove Does a constrained move without need to double click.
414
415 f.opaquemove Opaque move even when OpaqueMove is deactivated.
416
417 f.relativeresize Do a relative resize without need to double click.
418
419
420 I hope you enjoy tvtwm, and I hope that I have helped in such. If you
421have any questions/comments/etc, please mail me at cross@eng.umd.edu.
422Best wishes.
423
424 - Chris P. Ross
425
426--
427Chris P. Ross University Of Maryland
428cross@eng.umd.edu Engineering Computer Facility
429Work#: (301)/405-3689 Project GLUE
430