A lightweight hotkey daemon
C Makefile
Latest commit 9230020 Jul 26, 2016 @wertarbyte add absolute axis inputs
Failed to load latest commit information.
systemd Add systemd socket activation support and systemd unit files. Jun 13, 2016
udev update udev rules (SYSFS->ATTRS) Mar 8, 2011
.gitignore update generation of input definitions Oct 1, 2015
AUTHORS update documentation Oct 23, 2010
COPYING update documentation Oct 23, 2010
Makefile Add systemd socket activation support and systemd unit files. Jun 13, 2016
README update documentation Oct 27, 2010
cmdsocket.c Add systemd socket activation support and systemd unit files. Jun 13, 2016
cmdsocket.h clarify licence information (GPLv3 or later) May 10, 2011
command.h clarify licence information (GPLv3 or later) May 10, 2011
devices.c clarify licence information (GPLv3 or later) May 10, 2011
devices.h clarify licence information (GPLv3 or later) May 10, 2011
devtag.h clarify licence information (GPLv3 or later) May 10, 2011
eventnames.c add absolute axis inputs Jul 26, 2016
eventnames.h clarify licence information (GPLv3 or later) May 10, 2011
eventtable.h add absolute axis inputs Jul 26, 2016
ignore.c clarify licence information (GPLv3 or later) May 10, 2011
ignore.h clarify licence information (GPLv3 or later) May 10, 2011
keystate.c clarify licence information (GPLv3 or later) May 10, 2011
keystate.h clarify licence information (GPLv3 or later) May 10, 2011
obey.c clarify licence information (GPLv3 or later) May 10, 2011
obey.h clarify licence information (GPLv3 or later) May 10, 2011
th-cmd.c Make --tag work with --udev Jun 12, 2016
th-cmd.pod add documentaion for device tags Dec 8, 2010
thd.c add absolute axis inputs Jul 26, 2016
thd.h clarify licence information (GPLv3 or later) May 10, 2011
thd.pod add absolute axis inputs Jul 26, 2016
trigger.c Set TH_DEVICE environment variable so that triggers know the origin o… May 24, 2011
trigger.h clarify licence information (GPLv3 or later) May 10, 2011
triggerhappy.conf.examples pass device struct to run_triggers function Dec 8, 2010
triggerparser.c remove leading whitespaces from command lines Feb 14, 2012
triggerparser.h clarify licence information (GPLv3 or later) May 10, 2011
uinput.c clarify licence information (GPLv3 or later) May 10, 2011
uinput.h clarify licence information (GPLv3 or later) May 10, 2011
version.inc increment version to 0.4.0 Jun 13, 2016

README

Triggerhappy
- a lightweight hotkey daemon -

by Stefan Tomanek <stefan.tomanek+th@wertarbyte.de>
http://github.com/wertarbyte/triggerhappy/

Triggerhappy is a hotkey daemon developed with small and embedded systems in
mind, e.g. linux based routers. It attaches to the input device files and
interprets the event data received and executes scripts configured in its
configuration.

Examples:

Dump all events received through two device files:

	thd --dump /dev/input/event0 /dev/input/event1

Event handlers can be defined in configuration files (specified by --triggers).
If a directory is specified, all configuration files within matching the
pattern *.conf are loaded. The files use the following format:

<event name>	<event value>	<command line>

e.g.

KEY_VOLUMEUP	1		/usr/bin/amixer set Master 5%+
KEY_VOLUMEUP	2		/usr/bin/amixer set Master 5%+
KEY_VOLUMEDOWN	1		/usr/bin/amixer set Master 5%-
KEY_VOLUMEDOWN	2		/usr/bin/amixer set Master 5%-

A value of 1 corresponds to pressing a key, while 2 is generated by
holding it; releasing it yields a value of 0.

It is also possible to append up to 5 modifiers to each event definition by
appending their names to the event name:

KEY_VOLUMEUP+KEY_LEFTSHIFT	1	/usr/bin/amixer set Master 15%+

Devices can be added dynamically by specifying a command socket:

thd --socket /var/run/triggerhappy.socket --triggers /etc/triggerhappy.d/

The program th-cmd is used to add new devices to the daemon:

th-cmd /var/run/triggerhappy.socket add /dev/input/event0
th-cmd /var/run/triggerhappy.socket remove /dev/input/event3

An example udev script is also included to facilitate this hotplug
support - for this use, th-cmd can handle the parameter "udev" to
deduce the device name and action from the udev environment.

For more information, consult the manual pages of "thd" and "th-cmd".