summaryrefslogtreecommitdiffstats
path: root/bin/hornet/watch-kbd
blob: d5cd58399266f38b579fd1eb187ad1bc5afaf6ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash
set -eu
set -o pipefail

trap 'kill $(jobs -p)' EXIT

inotifywait -mq -e create -e delete --exclude '.*tmp.*' /dev/input/by-id/ | \
    while read -r event; do
        echo "$event"
        if echo "$event" | grep -q USB_Keyboard; then
            setup-inputs
        fi
    done &
wait