You are not logged in.

#1 2012-11-04 03:37:37

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Lightweight Hot key Daemon

keyd is a simple hot key daemon like esekeyd that i developed after i noticed that esekeyd was no longer in the official repositories.
It is developed entirely in c. It works by loading a config file that maps a key or multiple keys to a command. The keys are named the same as in linux/input.h but without the KEY_ part

AUR Package: https://aur.archlinux.org/packages/keyd/

Last edited by BennyBolton (2012-11-10 02:09:57)


HP DV6 + Arch + Openbox

Offline

#2 2012-11-04 23:40:13

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Re: Lightweight Hot key Daemon

Updated to version 0.2.0, changes:
- key mappings are now a list of modifiers and a single key  (still seperated by '+' though)

Last edited by BennyBolton (2012-11-05 08:45:33)


HP DV6 + Arch + Openbox

Offline

#3 2012-11-05 05:06:10

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Re: Lightweight Hot key Daemon

Updated to version 0.2.1, changes:
- "keyd --test" now outputs the whole hotkey (e.g. "LEFTCTRL+LEFTALT+F1")


HP DV6 + Arch + Openbox

Offline

#4 2012-11-10 02:09:42

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Re: Lightweight Hot key Daemon

Updated to version 0.3.0, changes:
- keyd now forks the commands
- output can be redirected using --log (for keyd messages) and --output (for command output)


HP DV6 + Arch + Openbox

Offline

#5 2012-11-11 20:05:27

bloom
Member
Registered: 2010-08-18
Posts: 749
Website

Re: Lightweight Hot key Daemon

It's surprisingly small!

Therefore, I couldn't resist the temptation of rewriting it wink :
    https://bbs.archlinux.org/viewtopic.php?pid=1191484

The only non-stylistic problems I found in keyd are the following:
- You're not handling key repeat events.
- You shall check read's return value: the keyboard could be unplugged.
- The systemd service you ship will not work "out of the box".


gh · da · ds · cr · ab · fkr

Offline

#6 2012-11-13 08:50:22

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Re: Lightweight Hot key Daemon

updated to 0.4.0

bloom wrote:

- You're not handling key repeat events.
- You shall check read's return value: the keyboard could be unplugged.

Done and done

- The systemd service you ship will not work "out of the box".

I assume you mean because your keyboard isn't event0? if --input is not specified, keyd now reads through /dev/input/by-id and /dev/input/by-path in that order and uses the first file ending with -kbd


HP DV6 + Arch + Openbox

Offline

#7 2013-10-30 13:24:01

BennyBolton
Member
From: Christchurch New Zealand
Registered: 2011-10-14
Posts: 63
Website

Re: Lightweight Hot key Daemon

I found a bug in keyd, went to fix it but instead decided to completely rewrite it. For a few reasons, including the new version being completely incompatible, I renamed it to bkeyd.

There are a few differences between keyd and bkeyd, for example, bkeyd uses a select loop to listen to multiple devices, and is more secure, as it doesn't pass the device file descriptors to its children. Also the code is a lot tidier, and generally better, as I'm currently at uni and have learn't more techniques that help, e.g. hash tables.

Its still very lightweight, and runs in a little less memory than the multithreaded version, at about 700 KB on my computer

Anyway the bug I spotted in keyd, where it refuses to read from a keyboard if its been unplugged then plugged back in a couple times, doesn't happen in bkeyd smile

My server isn't up any more, so bkeyd is now hosted at Sourceforge

AUR: https://aur.archlinux.org/packages/bkeyd/


HP DV6 + Arch + Openbox

Offline

Board footer

Powered by FluxBB