The Gregory Jay Blog



DWM

What's in a Window Manager?

I've been using i3 for a few years and for most of that time I have loved using it. Even today I still really like using i3 but as time has gone on and I have gotten used to the benefits of using i3 I am, more and more, noticing the deficiencies that i3 has. I think this is also in part because I now have a better understanding of some other window managers and what they can do better than i3.

I recently upgraded a laptop at home and so had a chance for a fresh Arch install. Rather than just installing i3 and getting on with it I thought I'd make a change and see what DWM could offer me. DWM often gets talked up as the grand daddy of window managers and I was aware of the fairly steep learning curve, it's written in C and the way to configure is by making alteration to that source code.

I made a few superficial changes and it compiled with no problems and then just started using it to configure my new system. Once I had all my software installed and file synced over, I went back to try some more configuration to get DWM at least as convieniant as my i3 setup and hopefully a lot more streamlined. This is where the real weakness of DWM in my opinion comes to light. The code is not commented to any great extent and cetainly not enough for someone who doesn't know C to be able to change in any meaningful way. There is also as far as I can tell, no documentation to go into the specifics of the functions in the DWM.c file. I think a summary of each function would be helpful with an example or 2 of how to somone might want to change it and how one might use it would be very helpful.

I think that unless DWM is intended to be a WM only for C coders it really does need some extra documentation (or at least comments) for people that are willing to rewrite code but need a guide.

That being said, right now I am in mid-decision: to stay with DWM and start learning C to get it where I want it to be, or to give up and move to BSPWM which I can configure in bash or python right now. Rather than actually make a decision I have decided to choose a method to make the decision instead (procrastinate more and avoid decision making FTW!) So, I'm going to make a list of what I actually want my WM to be able to do then just choose whichever WM can actually do it with the least amount of hassle, sound good? Let's go!

  • 1. Keybindings (obviously!)
  • 2. Not need to manually configure the positioning of windows (like in i3)
  • 3. Be able to write scripts that access the functions of the WM (e.g. when I mount an SD card to automatically open a certain workspace, run a script that copies the images to a directory, open darktable and a file browser and change the layout) - In i3 I can write a script that opens the programs and copies the files and bind it to a key that first changes the workspace but I can't open a new workspace from the script only from the i3 config file. I know this is doable in BSPWM as any script can call bspc to to configure the WM in real time. I assume its doable in DWM, but how? I have no idea. I know there is a patch for DWM that allows a program to open on a certain 'tag' and then to pull focus to that tag and I'm sure that would help me get closer to what I want but even for configuring that patch, there is no documentation and it just says "Be sure to update the config.h file correspondingly."
  • 4. To be able to open scripts easily with a keybinding - all 3 can do this fairly easily.
  • 5. I would prefer that the workspaces or tags work well with a multiple monitor setup as i3 does
  • 6. In i3 I cannot jump from workspace to workspace using mod+1,2,3 etc as is the default behaviour. Instead I only use mod+ctrl+h/l to move from workspace to workspace in order. I find it much quicker even though I may need to press multiple times (say to get from workspace 1 to workspace 4 I would hold mod+ctrl and press 'l' 3 times) as I don't need to lift my fingers from the center row. More importantly in frees up my mod+1,2,3etc for another behaviour: to move to a workspace and open the associated program in one keybinding. E.g. mod+2 opens workspace 2 and my broswer. Mod+3 opens workspace 3 and opens darktable. Mod+4 opens workspace 4 and opens my file manager etc. It would be best to keep this or some similar behaviour.
  • 7. The extensibility of DWM cannot be ignored especially as there is such a community around the software that has already created a large number of patches that can be used immediately. BSPWM as far as I know doesn't have such an ecosystem around it. Nor does i3. Although I havent really looking in to it and so that is what I need to do next to make the decision I think.
  • If anyone was to read this I think they're first thought would be "why does it matter? Just pick one and start using it!" And they would probably be right.

    Greg is a true Sinophile, fluent in Chinese and proficient in Tibetan he is a homeschooling Dad that also consults on the side. You'll often find him cigar in mouth, book in hand, waiting for someone to finish their work or for the coffee to brew.