Date:2010-11-20 16:38:01 (13 years 4 months ago)
Author:Xiangfu Liu
Commit:9c9b62d9fd8b730c508c7b2bd16718e6a9d46943
Message:Revert "remove <triggerhappy> since it went upstream" since the upstream triggerhappy 0.1.5 not working in NanoNote use decide use the old one 0.1.3 with kyak's patch

This reverts commit 18ed9b5cdfb23dae632125a994f501f6faa9c912.
Files: utils/triggerhappy/Makefile (1 diff)
utils/triggerhappy/files/triggerhappy-example.conf (1 diff)
utils/triggerhappy/files/triggerhappy.hotplug (1 diff)
utils/triggerhappy/files/triggerhappy.init (1 diff)

Change Details

utils/triggerhappy/Makefile
1#
2# This is free software, licensed under the GNU General Public License v2.
3# See /LICENSE for more information.
4#
5
6include $(TOPDIR)/rules.mk
7
8PKG_NAME:=triggerhappy
9PKG_VERSION:=0.1.3
10PKG_RELEASE:=1
11
12PKG_SOURCE:=$(PKG_VERSION).tar.gz
13PKG_SOURCE_URL:=http://github.com/wertarbyte/triggerhappy/tarball/release/
14PKG_MD5SUM:=7da137a7d2ba1ce396231e821e68de4e
15
16PKG_BUILD_DIR:=$(BUILD_DIR)/wertarbyte-triggerhappy-f7c4216/
17
18include $(INCLUDE_DIR)/package.mk
19
20define Package/triggerhappy
21  SECTION:=utils
22  CATEGORY:=Utilities
23  TITLE:=handle input events and run configured programs
24  URL:=http://github.com/wertarbyte/triggerhappy
25endef
26
27define Package/triggerhappy/description
28    triggerhappy - handle input events and run configured programs
29    The daemon thd can handle hotplugged input devices and is configured through
30    simple configuration files in /etc/triggerhappy/triggers.d/.
31endef
32
33MAKE_FLAGS += \
34    $(TARGET_CONFIGURE_OPTS) \
35    $(1)
36
37define Package/triggerhappy/install
38    $(INSTALL_DIR) $(1)/usr/sbin
39    $(INSTALL_DIR) $(1)/etc
40    $(INSTALL_DIR) $(1)/etc/init.d
41    $(INSTALL_DIR) $(1)/etc/triggerhappy
42    $(INSTALL_DIR) $(1)/etc/triggerhappy/triggers.d/
43    $(INSTALL_DIR) $(1)/etc/hotplug.d/input/
44    $(INSTALL_BIN) $(PKG_BUILD_DIR)/thd $(1)/usr/sbin
45    $(INSTALL_BIN) $(PKG_BUILD_DIR)/th-cmd $(1)/usr/sbin
46    $(INSTALL_BIN) ./files/triggerhappy.init $(1)/etc/init.d/triggerhappy
47    $(INSTALL_BIN) ./files/triggerhappy.hotplug $(1)/etc/hotplug.d/input/10-triggerhappy
48    $(INSTALL_BIN) ./files/triggerhappy-example.conf $(1)/etc/triggerhappy/triggers.d/example.conf
49endef
50
51$(eval $(call BuildPackage,triggerhappy))
utils/triggerhappy/files/triggerhappy-example.conf
1# This is an example configuration for the triggerhappy daemon (thd)
2# please note that every file to be processed must end in ".conf"
3#
4# To view a list of supported event codes, use "thd --listevents" or
5# "thd --dump /dev/input/event*"
6#
7# Format:
8# <eventcode> <value> <command>
9#
10# values for key events are 1 (pressed), 0 (released) or 2 (held)
11#
12## control an mpd instance
13# KEY_NEXTSONG 1 /usr/bin/mpc next
14# KEY_PREVSONG 1 /usr/bin/mpc prev
utils/triggerhappy/files/triggerhappy.hotplug
1#!/bin/sh
2THD_SOCKET=/tmp/triggerhappy.socket
3[ -S "$THD_SOCKET" ] || exit
4
5case "$ACTION" in
6    add)
7        DEVICE="/dev/$DEVNAME"
8        [ -c "$DEVICE" ] || exit
9        # offer device to triggerhappy daemon
10        /usr/sbin/th-cmd --socket "$THD_SOCKET" --add "$DEVICE"
11    ;;
12        remove)
13        # nothing to do
14    ;;
15esac
utils/triggerhappy/files/triggerhappy.init
1#!/bin/sh /etc/rc.common
2START=93
3
4start() {
5    /usr/sbin/thd --socket /tmp/triggerhappy.socket --triggers /etc/triggerhappy/triggers.d/ --daemon /dev/input/event*
6}
7
8stop() {
9    /usr/sbin/th-cmd --socket /tmp/triggerhappy.socket --quit
10}

Archive Download the corresponding diff file



interactive