Re: [dev] hotkey (1) - a suckless global keybinder

From: Calvin Morrison <mutantturkey_AT_gmail.com>
Date: Sun, 9 Feb 2014 01:22:00 -0500

On 9 February 2014 01:07, Chris Down <chris_AT_chrisdown.name> wrote:
> On 2014-02-08 18:37:19 -0500, Calvin Morrison wrote:
>> I have had a love affair with dwm's config.h. Unfortunately I also
>> love i3, and also deal with a plethora of other desktops on my day to
>> day work. so I created hotkey (1).
>>
>> Why wasn't there a simple way to have hotkeys, dealt with properly, in
>> a suckless manner? I don't want inane bindings for every WM, I don't
>> even want my wm controlling my hotkeys! So I wrote it.
>
> A few comments:
>
> - What's with the weird inconsistent indentation? It makes your code
> really hard to read;

Not sure where you are reading it. My indentation is perfectly normal,
tabs mark a single level of indentation. Maybe you have a weird editor
setup or something with 16 spaces per tab?

> - You are using system(), which is highly unportable and extremely
> fragile;

I'm not so sure. What's a better solution? system() seems like a very
standard function. Portability is also not a real concern for me. mos
everybody uses linux who uses X11, if you are using something else,
well, then it's probably simple to write a patch. If there's a better
solution I am all for it though

> - There is no author attribution for the code taken from dwm, which is
> required;
> - You also failed to include the license header, which is required by
> the MIT license;

I h8 licensing schemes which make me read the text... somebody call
their lawyer and sue, looks like mit is not 4 me.

> - You are using the unportable "return 0" when returning from main() --
> use EXIT_SUCCESS instead.

good catch. I usually do, though when would it ever reach that point?
while(1) loops until the process exists, so maybe removin the line
would be even better.

> I did not look in detail at the code, there may be more issues.

please do, I am unfamilar with x11's api so i probably botched it quite a bit.
Received on Sun Feb 09 2014 - 07:22:00 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 09 2014 - 07:24:06 CET