summaryrefslogtreecommitdiffstats
path: root/laptop
diff options
context:
space:
mode:
Diffstat (limited to 'laptop')
-rwxr-xr-xlaptop/.bin/watch-kbd14
-rw-r--r--laptop/.config/systemd/user/watch-kbd.service2
2 files changed, 15 insertions, 1 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
diff --git a/laptop/.config/systemd/user/watch-kbd.service b/laptop/.config/systemd/user/watch-kbd.service
index 415d8fb..b1a2add 100644
--- a/laptop/.config/systemd/user/watch-kbd.service
+++ b/laptop/.config/systemd/user/watch-kbd.service
@@ -1,5 +1,5 @@
[Service]
-ExecStart=%h/.bin/%H/watch-kbd
+ExecStart=%h/.bin/watch-kbd
Restart=always
[Install]