From a8b20e6efbae662ae6d770417814a431755d1f68 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 27 Feb 2024 21:38:56 -0500 Subject: move the script over too --- laptop/.bin/watch-kbd | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 laptop/.bin/watch-kbd (limited to 'laptop/.bin/watch-kbd') diff --git a/laptop/.bin/watch-kbd b/laptop/.bin/watch-kbd new file mode 100755 index 0000000..269213e --- /dev/null +++ b/laptop/.bin/watch-kbd @@ -0,0 +1,14 @@ +#!/bin/bash +set -eu +set -o pipefail + +trap 'kill $(jobs -p)' EXIT + +inotifywait -mq -e create -e delete -e moved_to --exclude '.*tmp.*' /dev/input/by-path/ | + while read -r event; do + echo "$event" + if echo "$event" | grep -q -- '-usb.*-kbd'; then + setup-inputs + fi + done & +wait -- cgit v1.2.3-54-g00ecf