summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/hornet/watch-kbd7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/hornet/watch-kbd b/bin/hornet/watch-kbd
index cbb3824..d5cd583 100755
--- a/bin/hornet/watch-kbd
+++ b/bin/hornet/watch-kbd
@@ -1,11 +1,14 @@
-#!/bin/sh
+#!/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
+ done &
+wait