system/triggerhappy: Expand/fix README.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2021-08-23 03:09:49 -04:00 committed by Willy Sudiarto Raharjo
parent 69104d2dc7
commit 69946fbdb2
No known key found for this signature in database
GPG key ID: 3F617144D7238786
4 changed files with 24 additions and 9 deletions

View file

@ -4,26 +4,40 @@ Triggerhappy is a hotkey daemon that operates on a system wide
scale. It watches all configured input devices for key, switch,
or button events and can launch arbitrary commands specified by the
administrator. In contrast to hotkey services provided by desktop
environments, Triggerhappy is especially suited to hardware related
environments, triggerhappy is especially suited to hardware related
switches like volume or wifi control; it works independently from
a specific user being logged in and is also suitable for embedded
systems that do not have a graphical user interface.
The disadvantage of using triggerhappy is that it must be run with
root privileges.
root privileges. However, it will drop root privilege and run as
'nobody' after initialization, with the provided rc.triggerhappy
script.
After installing the package, you'll want to:
1. Read the man page for thd, particularly the EXAMPLES section.
2. Create one or more confg files, matching the pattern:
2. Create one or more config files, matching the pattern:
/etc/triggerhappy/triggers.d/*.conf
See the example files in /etc/triggerhappy/triggers.d/ for ideas.
3. chmod +x /etc/rc.d/rc.triggerhappy
4. /etc/rc.d/rc.triggerhappy start
5. Test that things work the way you want, according to your config
files from step 2. If not, fix them. Don't forget to run
/etc/rc.d/rc.triggerhappy restart after editing the config(s).
6. Add this to your /etc/rc.d/rc.local:
if [ -x /etc/rc.d/rc.triggerhappy ]; then
/etc/rc.d/rc.triggerhappy start
fi
After this, the daemon will start on boot. To add devices to the
running daemon, use th-cmd's --passfd option (not --add, since the
daemon drops privileges after startup).

View file

@ -3,8 +3,12 @@
# rc.triggerhappy, sysv-style init script for triggerhappy.
# part of the slackbuilds.org triggerhappy build.
# The daemon has to be started as root, but will drop privileges
# and run as this user after initialization:
THD_USER=nobody
THD_SOCKET=/var/run/thd.socket
THD_ARGS="--daemon --user nobody --socket $THD_SOCKET --triggers /etc/triggerhappy/triggers.d/ /dev/input/event*"
THD_ARGS="--daemon --user $THD_USER --socket $THD_SOCKET --triggers /etc/triggerhappy/triggers.d/ /dev/input/event*"
case "$1" in
""|"start") if [ -e $THD_SOCKET ]; then

View file

@ -12,7 +12,7 @@ triggerhappy: Triggerhappy is a hotkey daemon that operates on a system wide
triggerhappy: scale. It watches all configured input devices for key, switch,
triggerhappy: or button events and can launch arbitrary commands specified by the
triggerhappy: administrator. In contrast to hotkey services provided by desktop
triggerhappy: environments, Triggerhappy is especially suited to hardware related
triggerhappy: environments, triggerhappy is especially suited to hardware related
triggerhappy: switches like volume or wifi control; it works independently from
triggerhappy: a specific user being logged in and is also suitable for embedded
triggerhappy: systems that do not have a graphical user interface.

View file

@ -10,7 +10,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=triggerhappy
VERSION=${VERSION:-0.5.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -24,9 +24,6 @@ if [ -z "$ARCH" ]; then
esac
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0