summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2024-02-23 02:12:28 -0500
committerJesse Luehrs <doy@tozt.net>2024-02-23 02:12:28 -0500
commit8a101b9fddfa5f1ddaa34aa66c05155a46669f36 (patch)
tree60cb5f4d74920fb48a9d810ab4fb327a2632cc7d
parent374ba3423e11e31e8fd7ade4247e0dd85e4c5716 (diff)
downloadconf-8a101b9fddfa5f1ddaa34aa66c05155a46669f36.tar.gz
conf-8a101b9fddfa5f1ddaa34aa66c05155a46669f36.zip
convert watch-kbd to systemd
-rwxr-xr-xlocal/.bin/hornet/setup-inputs4
-rwxr-xr-xlocal/.bin/hornet/watch-kbd4
-rw-r--r--local/.config/systemd/user/watch-kbd.service5
-rwxr-xr-xlocal/.services/available/watch-kbd/log/run4
-rwxr-xr-xlocal/.services/available/watch-kbd/run3
-rw-r--r--local/Makefile9
6 files changed, 16 insertions, 13 deletions
diff --git a/local/.bin/hornet/setup-inputs b/local/.bin/hornet/setup-inputs
index 572feb1..cd1b4cf 100755
--- a/local/.bin/hornet/setup-inputs
+++ b/local/.bin/hornet/setup-inputs
@@ -14,5 +14,5 @@ xinput set-prop "$touchpad" "libinput Accel Speed" 0.4
xinput set-prop "$touchpad" "libinput Tapping Enabled" 1
# needs to happen after xmodmap stuff
-svre xcape
-svre xbindkeys
+systemctl --user restart xcape
+systemctl --user restart xbindkeys
diff --git a/local/.bin/hornet/watch-kbd b/local/.bin/hornet/watch-kbd
index a4d504e..269213e 100755
--- a/local/.bin/hornet/watch-kbd
+++ b/local/.bin/hornet/watch-kbd
@@ -4,10 +4,10 @@ set -o pipefail
trap 'kill $(jobs -p)' EXIT
-inotifywait -mq -e create -e delete -e moved_to --exclude '.*tmp.*' /dev/input/by-id/ |
+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_Keyboard; then
+ if echo "$event" | grep -q -- '-usb.*-kbd'; then
setup-inputs
fi
done &
diff --git a/local/.config/systemd/user/watch-kbd.service b/local/.config/systemd/user/watch-kbd.service
new file mode 100644
index 0000000..aa9dc8e
--- /dev/null
+++ b/local/.config/systemd/user/watch-kbd.service
@@ -0,0 +1,5 @@
+[Service]
+ExecStart=%h/.bin/%H/watch-kbd
+
+[Install]
+WantedBy=default.target
diff --git a/local/.services/available/watch-kbd/log/run b/local/.services/available/watch-kbd/log/run
deleted file mode 100755
index 8b56264..0000000
--- a/local/.services/available/watch-kbd/log/run
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-set -eu
-
-exec multilog t s16777215 "$HOME/.log/watch-kbd"
diff --git a/local/.services/available/watch-kbd/run b/local/.services/available/watch-kbd/run
deleted file mode 100755
index f964c1a..0000000
--- a/local/.services/available/watch-kbd/run
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-exec watch-kbd 2>&1
diff --git a/local/Makefile b/local/Makefile
index 6684014..a16e3bc 100644
--- a/local/Makefile
+++ b/local/Makefile
@@ -1,4 +1,9 @@
include ../Makefile.include
-install: $(HOME)/.services/enabled/watch-kbd
- @mkdir -p $(HOME)/.log/watch-kbd
+install:
+ @systemctl --user enable watch-kbd
+ @systemctl --user start watch-kbd
+
+uninstall:
+ @systemctl --user stop watch-kbd
+ @systemctl --user disable watch-kbd