I recently applied my first suckless software patch. It was the attachaside patch for dwm. I did it because I’m not a fan of the default behavior where dwm opens new windows in the master area. This is also a very small patch so it felt like a good enough way to lean how to do this.

The step are as follow (I did this on ArchLinux):

  • navigate to your dwm folder (for me it is @ /usr/local/dwm)
  • run curl -o filename.diff https://url/to/filename.diff
    • this downloads the content of the patch file to a file in the dwm folder
  • run patch < path/to/filename.diff
    • this applies the changes to the correct files (these are taken care of by the diff file)
  • compile dwm again

To revert your changes, you can run patch -R < filename.diff.

That’s all there is to it.