aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/keyboard-daemon
diff options
context:
space:
mode:
authorcrees <crees@FreeBSD.org>2013-03-03 19:57:44 +0800
committercrees <crees@FreeBSD.org>2013-03-03 19:57:44 +0800
commit75f3ab7227c90b8de5ea15f0657cd6d5c08b3074 (patch)
tree3aa83b491dbc9d33953b088eecd0abf938c437ee /sysutils/keyboard-daemon
parent0d72eb6ba6b05fe8a44946edda741694938bba4a (diff)
downloadfreebsd-ports-gnome-75f3ab7227c90b8de5ea15f0657cd6d5c08b3074.tar.gz
freebsd-ports-gnome-75f3ab7227c90b8de5ea15f0657cd6d5c08b3074.tar.zst
freebsd-ports-gnome-75f3ab7227c90b8de5ea15f0657cd6d5c08b3074.zip
The author has not found any simple programs that listen on a device and
run commands based on the values received. keyboard-daemon binds to a device (for example, a remote control) and listens for button presses. These are then mapped to programs that are executed. WWW: http://www.bayofrum.net/cgi-bin/fossil/keyboard-daemon/
Diffstat (limited to 'sysutils/keyboard-daemon')
-rw-r--r--sysutils/keyboard-daemon/Makefile33
-rw-r--r--sysutils/keyboard-daemon/distinfo2
-rw-r--r--sysutils/keyboard-daemon/files/keyboard_daemon.in44
-rw-r--r--sysutils/keyboard-daemon/pkg-descr8
4 files changed, 87 insertions, 0 deletions
diff --git a/sysutils/keyboard-daemon/Makefile b/sysutils/keyboard-daemon/Makefile
new file mode 100644
index 000000000000..9ac2e499de41
--- /dev/null
+++ b/sysutils/keyboard-daemon/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+PORTNAME= keyboard-daemon
+PORTVERSION= 0.5
+CATEGORIES= sysutils
+MASTER_SITES= http://www.bayofrum.net/dist/${PORTNAME}/
+
+MAINTAINER= crees@FreeBSD.org
+COMMENT= Listens on a keyboard device and executes commands on keypresses
+
+BUILD_DEPENDS= ${LOCALBASE}/lib/libcfu.a:${PORTSDIR}/devel/libcfu
+
+USE_BZIP2= yes
+
+USE_RC_SUBR= ${PORTNAME:S/-/_/}
+PLIST_FILES= bin/${PORTNAME}
+PORTEXAMPLES= *
+MAN1= ${PORTNAME}.1
+MANCOMPRESSED= yes
+
+.include <bsd.port.options.mk>
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin/
+ ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1.gz ${MAN1PREFIX}/man/man1/
+.if ${PORT_OPTIONS:MEXAMPLES}
+ ${MKDIR} ${EXAMPLESDIR}
+ for f in ${WRKSRC}/examples/*; do \
+ ${INSTALL_DATA} $$f ${EXAMPLESDIR}; \
+ done
+.endif
+
+.include <bsd.port.mk>
diff --git a/sysutils/keyboard-daemon/distinfo b/sysutils/keyboard-daemon/distinfo
new file mode 100644
index 000000000000..c4d810aaa885
--- /dev/null
+++ b/sysutils/keyboard-daemon/distinfo
@@ -0,0 +1,2 @@
+SHA256 (keyboard-daemon-0.5.tar.bz2) = 28f97ba20105953d6564b203704ffdf1f905b74567580309c3eee6cf9d7ab63b
+SIZE (keyboard-daemon-0.5.tar.bz2) = 4280
diff --git a/sysutils/keyboard-daemon/files/keyboard_daemon.in b/sysutils/keyboard-daemon/files/keyboard_daemon.in
new file mode 100644
index 000000000000..c90c27a52ad4
--- /dev/null
+++ b/sysutils/keyboard-daemon/files/keyboard_daemon.in
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: keyboard_daemon
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable this service:
+#
+# keyboard_daemon_enable: Set to no by default; set to yes to enable it.
+# keyboard_daemon_device: Set to the name of your keyboard device, such
+# as /dev/ukbd0
+# CARE-- this will disconnect your keyboard from
+# the kbdmux, do not use on your only keyboard!
+#
+# Optional:
+#
+# keyboard_daemon_conf: Defaults to %%PREFIX%%/etc/keyboard-daemon.conf
+
+. /etc/rc.subr
+
+name=keyboard_daemon
+rcvar=keyboard_daemon_enable
+
+load_rc_config keyboard_daemon
+
+: ${keyboard_daemon_enable:=no}
+
+pidfile=/var/run/keyboard-daemon.pid
+required_files=${keyboard_daemon_conf}
+command=%%PREFIX%%/bin/keyboard-daemon
+command_args="-d -p $pidfile ${keyboard_daemon_conf+-f keyboard_daemon_conf} /dev/ukbd0"
+
+start_precmd=keyboard_daemon_prestart
+stop_postcmd="kbdcontrol -a ${keyboard_daemon_device} < /dev/console"
+
+keyboard_daemon_prestart()
+{
+ : ${keyboard_daemon_device:?keyboard_daemon_device must be set in rc.conf}
+ kbdcontrol -A ${keyboard_daemon_device} < /dev/console
+}
+
+run_rc_command $1
diff --git a/sysutils/keyboard-daemon/pkg-descr b/sysutils/keyboard-daemon/pkg-descr
new file mode 100644
index 000000000000..69eac9fc6e9f
--- /dev/null
+++ b/sysutils/keyboard-daemon/pkg-descr
@@ -0,0 +1,8 @@
+The author has not found any simple programs that listen on a device and
+run commands based on the values received.
+
+keyboard-daemon binds to a device (for example, a remote control) and
+listens for button presses. These are then mapped to programs that are
+executed.
+
+WWW: http://www.bayofrum.net/cgi-bin/fossil/keyboard-daemon/