diff options
Diffstat (limited to 'triggersad')
| -rw-r--r-- | triggersad/Makefile | 54 | ||||
| -rw-r--r-- | triggersad/files/triggerhappy-example.conf | 14 | ||||
| -rw-r--r-- | triggersad/files/triggerhappy.hotplug | 15 | ||||
| -rw-r--r-- | triggersad/files/triggerhappy.init | 10 | ||||
| -rw-r--r-- | triggersad/patches/001-input.patch | 12 |
5 files changed, 105 insertions, 0 deletions
diff --git a/triggersad/Makefile b/triggersad/Makefile new file mode 100644 index 0000000..d8fbc5d --- /dev/null +++ b/triggersad/Makefile @@ -0,0 +1,54 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=triggersad +PKG_VERSION:=0.1.3 +PKG_REV:=f7c42167127fb8377f99440f943ab863433b14b5 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=git://github.com/wertarbyte/triggerhappy +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +include $(INCLUDE_DIR)/package.mk + +define Package/triggersad + SECTION:=utils + CATEGORY:=Utilities + TITLE:=handle input events and run configured programs + URL:=http://github.com/wertarbyte/triggerhappy +endef + +define Package/triggersad/description + triggerhappy - handle input events and run configured programs + The daemon thd can handle hotplugged input devices and is configured through + simple configuration files in /etc/triggerhappy/triggers.d/. +endef + +MAKE_FLAGS += \ + $(TARGET_CONFIGURE_OPTS) \ + $(1) + +MAKE_VARS += TOOLCHAIN_DIR=$(TOOLCHAIN_DIR) + +define Package/triggersad/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/triggerhappy + $(INSTALL_DIR) $(1)/etc/triggerhappy/triggers.d/ + $(INSTALL_DIR) $(1)/etc/hotplug.d/input/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/thd $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/th-cmd $(1)/usr/sbin + $(INSTALL_BIN) ./files/triggerhappy.init $(1)/etc/init.d/triggerhappy + $(INSTALL_BIN) ./files/triggerhappy.hotplug $(1)/etc/hotplug.d/input/10-triggerhappy + $(INSTALL_BIN) ./files/triggerhappy-example.conf $(1)/etc/triggerhappy/triggers.d/example.conf +endef + +$(eval $(call BuildPackage,triggersad)) diff --git a/triggersad/files/triggerhappy-example.conf b/triggersad/files/triggerhappy-example.conf new file mode 100644 index 0000000..3a8017a --- /dev/null +++ b/triggersad/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/triggersad/files/triggerhappy.hotplug b/triggersad/files/triggerhappy.hotplug new file mode 100644 index 0000000..78ad349 --- /dev/null +++ b/triggersad/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/triggersad/files/triggerhappy.init b/triggersad/files/triggerhappy.init new file mode 100644 index 0000000..e846d29 --- /dev/null +++ b/triggersad/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 +} diff --git a/triggersad/patches/001-input.patch b/triggersad/patches/001-input.patch new file mode 100644 index 0000000..2f8d448 --- /dev/null +++ b/triggersad/patches/001-input.patch @@ -0,0 +1,12 @@ +diff -ur triggerhappy-0.1.3.orig/Makefile triggerhappy-0.1.3/Makefile +--- triggerhappy-0.1.3.orig/Makefile 2010-11-18 11:42:08.402150170 +0300 ++++ triggerhappy-0.1.3/Makefile 2010-11-18 12:09:55.033025473 +0300 +@@ -23,7 +23,7 @@ + --release="" \ + $< > $@ + +-evtable_%.h: /usr/include/linux/input.h ++evtable_%.h: $(TOOLCHAIN_DIR)/usr/include/linux/input.h + awk '/^#define $*_/ && $$2 !~ /_(MAX|CNT|VERSION)$$/ {print "EV_MAP("$$2"),"}' $< > $@ + + clean: |
