So you've decided to jump into the wonderful world of tiling window managers. It may seem like a daunting task but just remember two things: (1) in general to make changes to your set-up (your custom keybinded shortcuts, or the padding of your window tiles) you will need to find the appropriate configuration file to edit. Second, there's always a man page or a resource on the interwebs to help you change your files.
If you got a copy of DWM from your local package manager then un-install it right away. It is better to compile from source which can be found at suckless's website. Once you got a copy, extract the contents and boot up a terminal and cd into the dwm folder. For this tutorial we will be using Ubuntu's repos (12.10 to be exact); similar packages can be found for your specific distro (all you need is a bit of googling).
You're gonna need the following packages to compile and install DWM:
Once installed you are now ready to compile DWM. Look at the config.mk file first though; any of these look familiar? If not, then simply ignore it. But for veteran users, this where you can change the build paths if you have a customised system. This is also where'd you would go to mess with Xinerama for multiple screen support, but it is beyond the nature of this article. We're just about ready to compile all you have to do now is input
Or should I say the LightDM way. If you use the LightDM login manager, you will need to make your own .desktop ( found at /usr/share/xsessions/ ) session to boot up into DWM, if it's not already donefor you. Actually, you will most certainly need to create a .desktop session if you want to have a custom start-up script or a status bar with your own preset statuses (like time, temperatures, now playing data). Anyway let us make our own .desktop session just for DWM. Make a file dwm.desktop (make sure you are root since you are modifying a protected directory) and paste this:
The most important part here is
Now we must create our start up script, let's name is dwmstart. Ensure it has proper permissions by running
At this point you are technically done. You can do basic tasks, launching apps from the terminal. This is the core dwm experience with none of your customisation. Note that there is no network manager, no wallpaper set, and the status bar simply reads dwm-X.X. It is crucial to know the base dwm system, so if you ever need to fall back you know where you are!
Pretty much the same instructions as above without the need to make a .desktop session. .xinitrc is the start-up script for when you run
This is what decides what launches when you boot into your dwm session. For internet connectivity, launch your desired program wicd or nm-applet. You can set your default wallpaper here as well, using nitrogen or feh. It is crucial that you add & at the end of each line before exec dwm. This pretty much makes the program run in the background. So for restoring the wallpaper you would have
By default you have dwm-X.X showing at your status bar at the top right. This can be changed with xsetroot -name. Here we have a few simple examples of status bars:
Just the time
Battery level and status
Changing any of DWM's configuration requires you to edit config.def.h (then copying it to config.h). Changing the colors and the panel font involves editing the appearance section of the header file. Don't worry you don't need to know C. It's pretty readable, provided you have the patience.Changing the font is another task in itself. Boot up a terminal and run xfontsel and see what fonts are available to you. Otherwise you can add your own x11 fonts by doing the following:
1) Get your desired BDF or PCF font and place it in folder other than .fonts
2) Run mkfontdir on this directory
3) On your startup script add the following:
4) Reboot and run xfontsel again. NOTE: This method is a bit spotty even for me so you may need to hack your way out
5) You can avoid this mess and just install xft support.
For a multi-colored setup on your panel look into these patches:
You can change the 'workspaces' or tags by reffering to this section. By default you have it set from 1-9.
Some windows don't need to be tiled. Some windows need to be launched at a specific tag. Refer to this section.
As you can see Gimp here is marked as a floating window. Modify the isfloating value. Firefox is also set to launch to the 9th workspace or tag (start from 1 move 8 spaces to the right ). You can also add your own rules, to any window you'd like following the same format. The tricky part is finding the 'window class' value. This can be found by running
You can edit your key commands in this section.Define your command in the /* commands */ section. And set the appropriate key short cut in the Keys section.
I hoped you learned a thing or two. You are on your way to become a guru. You can add extra functionality by visting suckless patches for DWM or if you know C, you can make your own!