#!/bin/bash
function get-input-dev-activate-node() {
    local IFS=$'\n'
    pat=$1
    set -- $(
        for x in /sys/class/input/input*; do
            if cat $x/name | grep -qi "$pat"; then
		echo $x/active
	    fi
        done
    )
    if test $# -gt 1; then
	die "$pat match more than 1 input devices: $@"
    fi

    if test $# -lt 1; then
	die "$pat match no input devices"
    fi
    echo "$1"
}

if test "$(readlink -f "$BASH_SOURCE")" = "$(readlink -f "$(echo "$0" | grep / || which "$0")" )"; then
    "$(basename $0)" "$@"
fi
