forked from wertarbyte/triggerhappy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
52 lines (34 loc) · 1.82 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Triggerhappy
- a lightweight hotkey daemon -
by Stefan Tomanek <[email protected]>
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 --socket /var/run/triggerhappy.socket --add /dev/input/event0
th-cmd --socket /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".