diff options
author | Jesse Luehrs <doy@tozt.net> | 2024-02-27 21:38:56 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2024-02-27 21:38:56 -0500 |
commit | a8b20e6efbae662ae6d770417814a431755d1f68 (patch) | |
tree | 26c5a160546f7473fa93a896b0490a1ae7722754 /laptop/.bin/watch-kbd | |
parent | a2b90286a8f01bdf632d61799e8e74c80de840f8 (diff) | |
download | conf-a8b20e6efbae662ae6d770417814a431755d1f68.tar.gz conf-a8b20e6efbae662ae6d770417814a431755d1f68.zip |
move the script over too
Diffstat (limited to 'laptop/.bin/watch-kbd')
-rwxr-xr-x | laptop/.bin/watch-kbd | 14 |
1 files changed, 14 insertions, 0 deletions
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 |