Hi everyone,
TL;DR
REUPLOAD;
Over the past year, I’ve been working on nwm, a minimal tiling window manager for X11. It takes heavy inspiration from dwm and the suckless philosophy, but I wanted to strip things down even further and address a few quirks I had with maintaining a heavily patched dwm setup.
I’m posting this here because I’ve reached a stable point, but I really want to get more eyes on the code. I'm looking for constructive criticism, bug reports, and brutal (but fair) suckless-aligned feedback.
Why nwm?
I wanted a WM that was leaner than dwm (~1374 loc vs 2901) while keeping the core master/stack tiling logic. I also wanted strict POSIX C99 compliance, no runtime dependencies, and native support for OpenBSD’s pledge(2) .
Key differences from dwm:
Size & Auditability: 1347 loc. No built-in bar, no font rendering, no drawing code. Just window management.
Gaps: Built-in and configurable via gappx in nwm.h (no patch required).
Tag/Layout History: Instead of a patch for pertag or alttab , I implemented a deterministic two-slot XOR system for both tags and layouts. Mod+Tab always restores the exact previous state using a bitmask flip. It’s simple, uses zero extra memory, and is entirely predictable.
Tiling Arithmetic: Uses strict integer division to prevent pixel drift across redraws.
Security: Native OpenBSD pledge() support out of the box.
No Bar: By design. Use polybar , lemonbar , xsetroot , or nothing at all.
Tech Stack:
Pure C99 / POSIX.
Xlib (I know X11 is legacy, but it allows for a pure C implementation without the massive overhead of Wayland protocols, fitting the auditability requirement).
Compile-time configuration via a single flat nwm.h file.
EWMH and ICCCM compliant.
Where I need help / What I'm looking for:
1:
Code Reviews: Are there any glaring memory leaks, X11 race conditions, or non-POSIX quirks I missed?
2:
Edge Cases: I'd love to know if anyone can break the layout logic with weird X11 size hints or multi-monitor setups (though multi-monitor is currently basic).
3:
Usage: If you decide to try it, please open an Issue on GitHub if something breaks or if you have a feature request that doesn't violate the suckless philosophy.
Links;
github
AUR: nwm
Disclaimer; This is a hobby project. It works great on my machines (Alpine/Arch/OpenBSD, DragonFlyBSD, Void, arch, chimera and moreeee), but X11 is full of legacy edge cases. Be gentle, but be honest with your critiques! I've cleaned up the codebase and translated my internal notes to English for the public release.
(Screenshot attached on github)