lwm - Lightweight Window Manager

Introduction

lwm is a window manager for X that tries to keep out of your face. There are no icons, no button bars, no icon docks, no root menus, no nothing: if you want all that, then other programs can provide it. There's no configurability either: if you want that, you want a different window manager; one that helps your operating system in its evil conquest of your disc space and its annexation of your physical memory.

That paragraph has probably told you whether or not you're the sort of person who can cope with lwm. Welcome to my world!

User Guide

Input focus

lwm allocates input focus using a lazy focus-follows-mouse system. That's to say: if the mouse is not over the root window then the window in which it finds itself has input focus.

lwm decorations are exceedingly simple. You can see them all in the picture. Most windows visible will have a grey border a few pixels thick all the way around.

The window with input focus (for pointer events) has a black border rather than a grey border. The window with input focus will be the last window that the pointer entered that was capable of accepting input. This distinction may be made by a filled text cursor (as with xterm, for example).

Window manipulation

Button 1

A button 1 click on a window frame brings that window to the top. Dragging button 1 on the frame of a resizable window repositions that edge of the window. If a corner rather than an edge is dragged, then both edges forming the corner are repositioned. While you're reshaping a window, a little window pops up to show you the window's current size.

In the default configuration, button 1 on the root window does nothing.

Button 2

Button 2 is used to drag a window by its frame, repositioning the window but maintaining its position in the window stack.

In the default configuration, button 2 on the root window brings up a new shell.

Button 3

A button 3 click on a window frame makes that window disappear. Don't worry because...

Pressing button 3 on the root window brings up a menu. The various items unhide the named hidden window.

A button 3 click in the frame while Shift is held down pushes the window to the back, under any other windows. (Users with 4-button mice are encouraged to use their fourth button for this function.)

The `box'

A click with any button inside the little white box in a window's frame can be used to close the window.

Configuration via X resources

I lied when I said that you can't configure lwm. The sort of people who judge a program by the number of switches and resources it has won't be satisfied, but lwm does in fact recognise the following X resources:
ClassDescription
titleFontFontfont used in window titles
popupFontFontfont used in popup window (menu/size indicator)
borderBorderwidth in pixels of window borders
button1Commandprogram spawned when button 1 is clicked on the root window
button2Commandprogram spawned when button 2 is clicked on the root window

In addition to these ample facilities, there exists a powerful configuration tool called gcc.

Acknowledgements

This program's philosophy is based on no particular window manager, but inspiration has come from numerous sources. The general window hiding was first seen in Rob Pike's windowing system for Plan 9 (see his paper 8½, the Plan 9 Window System). The use of the right-hand button for hiding (rather than a menu of window operations as seen in ) came from experience of John Bradley's xv. The disappearing title-bars that lwm used to sport came about from a misunderstanding of BeOS' method of iconizing windows, and were removed when I decided that they were an annoying gimmick. The changing of cursor shape while reshaping is based on SGI's 4Dwm. The "box" in the top-left corner of the frame is meant to look like Pike's acme (see his paper Acme: A User Interface for Programmers; if you want something like acme for Unix, try Gary Capell's Wily). The automatic window placement heuristics are simple but effective, based upon personal experience. It would be nice to have a window manager that does more window management for us.

The code is at heart a rewrite of 9wm by David Hogan (see The 9wm Page) and the real thanks must go to him. It was seeing 9wm that made me think that writing a window manager wasn't such a ridiculous idea. I'd already written a window manager similar to lwm for Plan 9, based on - it seemed sensible to start the X version from a window manager with a similar outlook.

I'd long thought about writing a window manager (since 1993, in fact), but seeing the size of twm (and even uwm is larger than both 9wm and lwm) put me off. 9wm showed that a useful window manager doesn't need to be huge in either source or binary.

The O'Reilly books Xlib Programming Manual and X Protocol Reference Manual (volumes one and zero respectively in their series of books on the X Window System) were invaluable to me while writing lwm. Thanks to Adrian Nye for his brave effort to make sense of the nonsensical.

The following were brave enough to use lwm very early on, and proved a great source of encouragement and ideas: James Carter, Mawuli Lodoh, Stephen Parker, Al Smith, and Marcel Ward.

Various people have contributed bug fixes; see the source for details.

Downloading

lwm is freely available under the terms of the GPL and is available for download here. It's about 20 KBytes worth of gzipped tar file. If you try lwm, please mail me to let me know how you get on - whatever you think of it. If you have problems compiling or using lwm, have a look at the lwm FAQ.

Author

"Elliott Hughes" <elliott.hughes@genedata.com>