Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here, have a window manager I wrote, maybe it'll make your skin crawl right off: https://github.com/serprex/nobox/blob/master/nobox.c


That is COMPACT. I always thought that a window manager was supposed to be big. This fits in one file!

(A note on code style though: some of your lines are a bit too long. Have pity on those with small screens. Seriously, it's not that hard to break up line 94.)

Where can I learn enough about X to read this code?


I'd suggest reading the dwm source: http://git.suckless.org/dwm/tree/dwm.c

It's still one file, but it has more features & is less obfuscated

Otherwise I mostly learnt by reading XCB header files

That said things are going the way of Wayland, so I've since switched: https://github.com/serprex/noway


Thanks! Though I'd rather read yours. A couple of hundred lines seems less intimidating than a couple of thousand. Though still I doubt I'll get around to it.


Have pity on those with small screens.

How small are your screen(s)? What resolution do you run them at? What size font? Do you have eyesight issues?

I have decent vision at monitor distance. On a 13-inch Macbook Pro, using a font of reasonable size, I can easily diff two files with a line length of 108 - side-by-side.

I'm curious, then, why others can't do that. (Eyesight issues aside, of course.)

(Whether code lines should be 108 characters long is a separate issue.)


At home, my desktop has a resolution of 1366x768. (I usually use my laptop, which is higher than that, but whatever.) At work, I have monitors in the "portrait" position, so I only have 1080 horizontal pixels unless I'm willing to split something across two screens. (Never!)

But in this case, all that is not relevant. The link was to Github, and Github enforces a width of less than a thousand pixels, regardless of screen size.


I have monitors in the "portrait" position

Excellent, thanks. That's something I hadn't considered.

But in this case, all that is not relevant. The link was to Github, and Github enforces...

Ah. I assumed you were speaking generally.


Well, I mostly was. Long lines are _generally_ inconvenient. Everything from portrait screens to websites that won't use the full screen width to someone who wants to a printout of the code for some reason (even printing in landscape is not enough).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: