DWM tips

DWM tips

dwm is a very good window manager indeed. I started off on i3-gaps, like everyone else, but that was a terrible introduction to tiling. The manual stuff was too much.

I later switched to bspwm, which worked like a charm. However, dwm adds to the automatic tiling by managing master (specific number of focused windows) and stack areas (everything else). It helps you focus and makes for some good layout patches.

Do the patching yourself

Don't go off others’ builds. They are harder to patch and generally cause more difficulty. Get the newest build and start applying the patches yourself. Patching does come with some difficulties, the later you apply them, the more rejects you'll have. So be ready to do nvim -p *.rej to navigate the fluff.

Find your layout

For me, the centeredmaster layout worked best. It lets me focus on the task at hand better (centered > left). When I have a few splits open in Vim, I go into monocle mode to code. It may be different for you.

Get a good status program

Ideally, go with an intelligent status program - one that can handle signals for updating blocks (e.g. volume changes). I started off with dwmbar, which I hardly configured. Then I tried dwmblocks, and added a patch for multi-character separators, but the program terminated with unknown signal after a while.

So, I decided to go with Goblocks, which is written in Go, where it's impossible to obtain the various weird errors from C programs. It's somewhat easier to configure - just edit goblocks.json - and has few builtins for CPU and Memory usage (although I prefer to stick to free and awk). It's been working well for me.

Debugging

Often, bugs are caused by what you feed dwm, not dwm itself. A few days ago, my dwm was using 13% of my CPU, but I tracked it down to extremely frequent updates from Goblocks. Remember, if dwm did have a high-CPU-usage bug, it would instantly use 25% (100% divided by core count), not less.

Happy hacking!


.
├── my
│   ├── matrix
│   ├── email
│   ├── sourcehut
│   ├── lobsters
│   └── github
├── code
│   ├── i
│   ├── feef
│   ├── greedy
│   ├── typeup
│   ├── metro
│   └── point
├── blog
│   ├── Shell sins
│   ├── DWM tips
│   ├── How this site was made (old site)
│   └── Go as a dynamic plugin language for Go
├── wiki
├── notes
│   └── Tree-style blogs
├── pictures
├── webring
│   ├── bakpakin.com
│   ├── macwright.com
│   ├── arp242.net
│   ├── icyphox.sh
│   ├── zdsmith.com
│   ├── christine.website
│   ├── wiki.alopex.li
│   ├── erkin.party
│   ├── dave.cheney.net
│   ├── technomancy.us
│   ├── rxi.github.io
│   ├── hisham.hm
│   ├── junglecoder.com
│   ├── kivikakk.ee
│   ├── bernsteinbear.com
│   ├── 100r.co
│   ├── acha.ninja
│   ├── hillelwayne.com
│   ├── jvns.ca
│   ├── research.swtch.com
│   ├── eigenstate.org
│   └── drewdevault.com