ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/external/subpack/utils/triggerhappy/files/triggerhappy-example.conf b/external/subpack/utils/triggerhappy/files/triggerhappy-example.conf
new file mode 100644
index 0000000..3a8017a
--- /dev/null
+++ b/external/subpack/utils/triggerhappy/files/triggerhappy-example.conf
@@ -0,0 +1,14 @@
+# This is an example configuration for the triggerhappy daemon (thd)
+# please note that every file to be processed must end in ".conf"
+#
+# To view a list of supported event codes, use "thd --listevents" or
+# "thd --dump /dev/input/event*"
+#
+# Format:
+# <eventcode> <value> <command>
+#
+# values for key events are 1 (pressed), 0 (released) or 2 (held)
+#
+## control an mpd instance
+# KEY_NEXTSONG 1 /usr/bin/mpc next
+# KEY_PREVSONG 1 /usr/bin/mpc prev
diff --git a/external/subpack/utils/triggerhappy/files/triggerhappy.hotplug b/external/subpack/utils/triggerhappy/files/triggerhappy.hotplug
new file mode 100644
index 0000000..78ad349
--- /dev/null
+++ b/external/subpack/utils/triggerhappy/files/triggerhappy.hotplug
@@ -0,0 +1,15 @@
+#!/bin/sh
+THD_SOCKET=/tmp/triggerhappy.socket
+[ -S "$THD_SOCKET" ] || exit
+
+case "$ACTION" in
+ add)
+ DEVICE="/dev/$DEVNAME"
+ [ -c "$DEVICE" ] || exit
+ # offer device to triggerhappy daemon
+ /usr/sbin/th-cmd --socket "$THD_SOCKET" --add "$DEVICE"
+ ;;
+ remove)
+ # nothing to do
+ ;;
+esac
diff --git a/external/subpack/utils/triggerhappy/files/triggerhappy.init b/external/subpack/utils/triggerhappy/files/triggerhappy.init
new file mode 100644
index 0000000..e846d29
--- /dev/null
+++ b/external/subpack/utils/triggerhappy/files/triggerhappy.init
@@ -0,0 +1,10 @@
+#!/bin/sh /etc/rc.common
+START=93
+
+start() {
+ /usr/sbin/thd --socket /tmp/triggerhappy.socket --triggers /etc/triggerhappy/triggers.d/ --daemon /dev/input/event*
+}
+
+stop() {
+ /usr/sbin/th-cmd --socket /tmp/triggerhappy.socket --quit
+}