dwm (dynamic window manager) is a minimalist tiling window manager, famous for being ultra-lightweight and infamous for needing to be recomplied every time you make changes to the configuration. This has led to it gaining a reputation as “experts only”, but the aim of this howto is to show that this is not necessarily the case. For me, after using openbox, fluxbox, ratpoison, evilwm, icewm, I found that I knew what features I wanted and what I didn’t, and dwm just does its job with minimal fuss and maximum speed.

This howto is aimed at anyone from low-intermediate level upwards. You will need to be familiar with the terminal, root vs normal user commands and the basic Debian file-system structure (but the less you know now, the more you learn as you go, right? ) This howto also assumes that you are familiar with using a window manager, such as openbox, as opposed to a Desktop Environment like Gnome, KDE or XFCE.Substitute 'apt-get' for 'aptitude' if you prefer.

Any commands with a # at the start means “as root”.

Overview:Part 1: PreparationPart 2: ConfigurationPart 3: Installation

* Note: This howto will discuss two ways of installing dwm: the generic, quick-and-dirty “make install” way, and the ‘proper’ APT/Debian way. Both ways have their ups and downs; as always, it’s your system, just be aware of your choices.

Copy the default config file to config.h then open it.Use whatever editor you prefer to modify config.h, but I would recommend using one that allows syntax highlighting to help you understand what you’re doing

You can define the font the way you would for an xterm. The bottom two lines define whether it will be hidden and where it will be. Easy huh?The selected window has a one-pixel border by default, of color #0066ff (red, I think)The background and foreground colors refer to the status bar.

dwm has multiple desktops, but they’re called tags and work slightly differently. By default they are numbered 1-9, but you can rename them however you want, just put the names in quotes.The rules define how certain windows get treated, e.g. Gimp is always floating (not tiled or monocle/fullscreen) as it doesn't work properly otherwise.The “tags mask” defines which tag the window appears on. Basically read the “<<“ as “+”, so “1 << 8” means Firefox will be on tag 9.0 means any tag.

dwm has three layouts: tiling, floating (normal 'Windows' mode) and monocle (fullscreen). Here you can set the default layout, and the funky little symbol that will appear in the status bar.Above that you can select the amount of the screen that the master window takes up.

By default the modifier key is Alt (“Mod1Mask”). You could change it to Super/Windows by using "Mod4Mask" if you preferred.The TAGKEYS set what happens if you press the number for a tag along with a modifier, so Alt-3 will take you to tag 3, while Alt-Shift-3 will tag (attach) a window to tag 3.

The first two commands in the long list spawn commands; note how those commands are defined above that, with each separate part of the command in quotes and with NULL at the end. So any commands you wanted to add would need to be defined under ‘commands’, then called in the ‘keys’ section.XK_p means the button ’p’, etc.If instead of ‘MODKEY’ you put ‘0’, that would mean ‘no modifier’.‘focusstack’ means next or previous window, depending on the +1 or -1‘setmfact’ means set the size of the master window in tiling mode‘zoom’ is move a window to the master window in tiling mode‘setlayout’ chooses a layout based on the order defined earlier, starting numbering from 0The TAGKEYS select the tags - note that the tags as far as dwm is concerned number from 0-8.Lastly, Alt-Shift-q quits dwm and takes you back to a tty.

Here you define what happens when you click in various places, with and without the mod keys.‘ClkLtSymbol’ means ‘click layout symbol’.

**********************************************************

As you can see, there are a lot of options. The default config basically chucks them all in so you can use what you need and ditch what you don’t.I have found that I don’t need most of the options, so here is my config.h for reference after I took to it with a knife and added a couple of tricks:

Monocle (fullscreen) mode by default, and if I switch to tiling it’s usually with two windows so I split the screen 50:50‘resizehints = false’ so terminal windows don’t leave odd gaps around the edges.

Most apps I run from dmenu, but if you need to use something regularly with command line options, like chromium with a proxy server, you can define it here to call with a keybind.Also you need to define what command each of your XF86 keys will execute.

I’ve tried to stick to keybinds that don’t interfere with other apps, e.g. Alt-p is used to select ‘print’ on a print dialog page, so I've avoided that.The XF86 key "Launch1" for dmenu is actually the Super/Windows key, which I remap in ~/.xinitrc (see near the end of this howto)Alt-space simply toggles between monocle and tiling modes, as they are the only modes I specified earlier.Alt-comma and alt-period are for "Here" and "There" tags.

Click on the layout symbol to toggle tiling mode; click the status bar text and dmenu starts; right-click to get a terminal.Click on a tag name to view it; right-click on a tag name to send a window to that tag.

So that’s mine; go to town, or just try the default first, whatever. When you're done there, it’s time for…

*******************************************************************

Part 3: Installation

a) The generic quick-and-dirty method

This is the method from the README file. It will put dwm into /usr/local/bin which is good for two reasons: that directory is empty by default in Debian, and it is already in your $PATHThe disadvantage of this method is that APT will not be aware of its existence, so you have been warned.The advantage is that it is, well, quick:

This will spit out lots of output; the options given mean it shouldn't prompt you about unsigned files.When it finishes you should find your .deb in the parent directory, so cd up one level and install like so (as root):

I think it's spam. Great post BTW. This is exactly what I was looking for a couple of weeks ago when I considered giving dwm a try. But I didn't as I didn't have your guide! When I have time to try again I will come here.

Questions:--------------------1. Where can I find a complete list of the XK_ codes ? ( I got these from the azerty patch). I would like to use the § key.

2. I have a synaptic touchpad. Under dwm i can't use the scroll area. I also can't click by tapping the touchpad. I can set both under gnome. How can I set these under DWM?

EDIT: answer to question 2 (note that this is not really DWM related at all)

After reading the fine manual at: http://wiki.debian.org/SynapticsTouchpad I have managed to get it working by editing my /etc/X11/xorg.conf .I added the following new section below the InputDevice section:

I've updated it a bit to reflect my current usage. After using Gnome shell for a bit, I like the idea of pushing one button to get a launcher. I've been using F5 to fire up dmenu, and it hasn't clashed with anything yet. Maybe I should remap the Super/Windows key and use that... I don't think you can use a modkey on its own.

dwm beats Gnome shell for speed though, and tiling is the trump card for me.

Edit: After a quick trial, you can't use a modkey on its own, so you have to remap "Super_L" to something else. I remapped it to "XF86Launch1" and now it launches dmenu I'll update the original post to include this, just for the fun of it..

I'm having some trouble getting this to work with dpkg-buildpackage. I build the package as per these instructions, but none of my changes are in the resulting package. And when I diff config.def.h and config.h after building the package, the files are identical.

first off i want to say thanks to Loomx for this howto i really appreciated the experience of using dwm its really lightweight

my issue is ican 't get the status bar i 've read on the arch wiki and else where on the web by makin a shell script and call it with a file.desktop but nothing work

im using wheezy also when i download the satus.c file and put it in the source DIR dwm-6 when i launch the dpkg-buildpackage it stops with a message that i have to verify the changes in the file change.something (im not home so im sorry ican't post more details ill once im home )and i did not really get it

kosaidpo wrote:my issue is ican 't get the status bar i 've read on the arch wiki and else where on the web by makin a shell script and call it with a file.desktop but nothing work

I'm not sure exactly what you mean here; the easy way to get some info in your status bar is via a `while' loop in your ~/.xinitrc file. In the howto I mention how to do that, and there is another simple example in the dwm README that is included with the source code.

Note that the ~/.xinitrc file is an executable shell script that gets called by the command `startx'.dwm will ignore .desktop files - there is no "desktop", after all

kosaidpo wrote:also when i download the status.c file and put it in the source DIR dwm-6 when i launch the dpkg-buildpackage it stops with a message that i have to verify the changes in the file change.something

If you are trying to make a status bar program using C code, this is a different thing altogether. In this case you need to compile the file (e.g. status.c) into a stand-alone program, then run it from your ~/.xinitrc