Add triggerhappy: HID input device handler (#1211)
More information: <https://wiki.postmarketos.org/wiki/Troubleshooting:HID_buttons>
This commit is contained in:
parent
4b71aa8525
commit
f870333b99
2 changed files with 53 additions and 0 deletions
main/triggerhappy
30
main/triggerhappy/APKBUILD
Normal file
30
main/triggerhappy/APKBUILD
Normal file
|
@ -0,0 +1,30 @@
|
|||
# Contributor: alive4ever
|
||||
pkgname=triggerhappy
|
||||
pkgver=0.5.0
|
||||
pkgrel=0
|
||||
pkgdesc="A lightweight hotkey daemon"
|
||||
url="https://github.com/wertarbyte/triggerhappy"
|
||||
arch="all"
|
||||
license="GPL-3.0-or-later"
|
||||
makedepends="linux-headers perl"
|
||||
subpackages="$pkgname-doc"
|
||||
options="!check"
|
||||
source="triggerhappy-$pkgver.tar.gz::https://github.com/wertarbyte/triggerhappy/archive/release/$pkgver.tar.gz
|
||||
triggerhappy.openrc"
|
||||
builddir="$srcdir/$pkgname-release-$pkgver"
|
||||
|
||||
build() {
|
||||
cd "$builddir"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$builddir"
|
||||
make DESTDIR="$pkgdir/" install
|
||||
install -Dm 644 "$builddir/triggerhappy.conf.examples" "$pkgdir/etc/triggerhappy/triggers.d/triggerhappy.conf.examples"
|
||||
install -Dm 644 "$builddir/udev/triggerhappy-udev.rules" "$pkgdir/usr/lib/udev/rules.d/99-triggerhappy.rules"
|
||||
install -Dm 755 "$srcdir/triggerhappy.openrc" "$pkgdir/etc/init.d/triggerhappy"
|
||||
}
|
||||
|
||||
sha512sums="7a4c7a67a90a92e907fcc966902e9a1d5ebc702304ac4165d1a2733a0891dd08f4caf4e4677b41854fcd8021c03b2ffa118a34658dd5d4d97d538517457622dc triggerhappy-0.5.0.tar.gz
|
||||
f6762c7fd8c493bbc6ae996fa687979ff2675773f8fa3e15dc49f5fbf074c45f2d93fce532936691b55bea8f11937696c7544c982b89ac378512e7614fbcf439 triggerhappy.openrc"
|
23
main/triggerhappy/triggerhappy.openrc
Normal file
23
main/triggerhappy/triggerhappy.openrc
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
command="/usr/sbin/thd"
|
||||
command_args="--triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --deviceglob /dev/input/event* --pidfile=/run/triggerhappy.pid --daemon"
|
||||
pidfile="/run/triggerhappy.pid"
|
||||
|
||||
name="Triggerhappy"
|
||||
description="Triggerhappy hotkey daemon"
|
||||
|
||||
|
||||
start() {
|
||||
ebegin "Starting triggerhappy hotkey daemon"
|
||||
start-stop-daemon --start --exec "$command"\
|
||||
--pidfile "$pidfile" \
|
||||
-- $command_args
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping triggerhappy hotkey daemon"
|
||||
start-stop-daemon --stop --pidfile "$pidfile"
|
||||
eend $?
|
||||
}
|
Loading…
Reference in a new issue