kurt-vd / inputevent

Simple event monitoring program, ready to pipe its output to a shell script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inputevent

This program read input events from a device and emits them in readable text on stdout in the form TIME CODE VALUE

This makes it easy to pipe in a shell script like:

while read TIME CODE VALUE; do
case "$CODE" in
KEY_PLAY)
	mpc play
	;;
esac

To deploy easily, inputevent can spawn a child process that reads its output. You can then simply put a single statement in your service monitoring.

inputevent can also emit the initial state of the input device. This makes the boot procedure more predictable, you do not have to wait for inputevent to start before pressing a button, or setting a switch.

About

Simple event monitoring program, ready to pipe its output to a shell script

License:GNU General Public License v3.0


Languages

Language:C 99.4%Language:Makefile 0.6%