What Is The DWM Window Manager?

The dwm window manager for Linux is an incredibly small and efficient window manager for X. Like ratpoison, it is an ultra-lite Linux window manager, runs amazingly well in Linux, and in spite of its small size, has more features than is at first obvious.

Dwm is a tiling window manager, meaning that it arranges the multiple open windows on a computer screen in a tile manner. The windows fit tightly together and do not overlap. It’s about using up all the screen surface area with window content — not frills. It’s also about being able to quickly move between the windows.

Dwm is written entirely in the c programming language. In fact, the code is entirely in one rather small c file. Yet dwm can do screen display in three modes: monocle where each window takes the entire computer screen, tiled where windows take up the entire screen in adjacent tiles, and floating where windows may be moved, resized, and overlap. Quick key commands make the switch between these display modes.

The default mode is the tiled mode. While in ratpoison tiles are created manually, in dwm tiling is automatic. If one computer computer computer computer computer computer computer computer application is running, its window takes the entire screen. Add another application and the screen splits into two columns. The left column, by default, is the master frame. It will always be full height, and can resized in width. Check the man file for which are the resize keys. In the source version, the grow and shrink commands are alt-l and alt-h respectively.

The right column will contain the rest of the open windows in a vertical stack, with the column divided equally between the number of windows beyond the one in the master frame. Each newly launched application will occupy the master frame.

You can swap any focused window with that in the master frame just by entering alt-enter. Entering alt-space will change the display mode to floating. In this mode, the mouse can be used to move and resize windows, letting the windows violate the tiling restrictions. Holding down the alt key and the mouse button1 will let you move windows. The alt key and the mouse button3 will let you resize windows.

The alt-m key will switch the display to the monocle mode, where the screen is taken up by a single window. The alt-j and alt-k keys are used to step forward and back through the different windows to let them be the one displayed. In the floating and tile modes, the alt-j and alt-k keys move focus to the next or previous frame.

Dwm supports a multiple workspace concept with its tag system. When in a tag workspace, newly opened windows will become part of that tag. The windows will thus be visible only when the user in in that tag. A focused window can be moved to a different tag with the alt-shift-n key sequence, where n is the tag number. Entering alt-shift-0 while on a focused window will make that window visible on all tags.

To remove a focused window from a tag, enter alt-cntl-shift-n. You can check the man files and see how to also assign and remove windows from tags with mouse controls.

One limitation of dwm is that all tags will have the same display mode. That is, if you switch to the tiled mode in a tag, then move to another tag, the windows there will also be in the tile mode. This is unlike the ratpoison augmented with rpws windows manager, in which each workspace’s tile arrangement is retained. But — check out the patches section listed later.

In my Debian Etch Linux distribution, I was able to install dwm by doing apt-get install dwm. But if you want to be able to tune dwm to your liking, I suggest you get the entire package from the dwm link, from where you can download the source code and man file. This is useful because the tuning of dwm is done by making changes to the config.h header file and recompiling.

You may shudder at the thought of working with source code. I’ve had some bad experiences myself. It often seems that getting some complex, multi-file coded application to successfully compile is a monumental task. But dwm is different. It’s a single file that compiles quickly and easily. A book that might make you more comfortable with tuning your DWM is A Practical Guide to Linux Commands, Editors, and Shell Programming. Armed with a good Linux handbook, you’ll have the confidence to tailor your DWM install. And of course, there’s always the fallback Linux For Dummies.