From: Stefan Huber Date: Sun, 17 Dec 2023 19:25:55 +0000 (+0100) Subject: udev: Add xprofile-udevinput-monitor X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=11459be7250882eb3328215ec4b200b68dc82077;p=shutils.git udev: Add xprofile-udevinput-monitor --- diff --git a/udev/input/install.sh b/udev/input/install.sh new file mode 100644 index 0000000..59b4c22 --- /dev/null +++ b/udev/input/install.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +cp ./xprofile-udevinput ~/.xprofile-udevinput +echo "You may source ~/.xprofile-udevinput in your ~/.xinitrc or so" + +cp ./xprofile-udevinput-monitor ~/.local/bin/ +cp ./xprofile-udevinput-monitor.service ~/.config/systemd/user/ +systemctl --user daemon-reload + +echo "You may call systemctl --user enable xprofile-udevinput-monitor.service" diff --git a/udev/input/xprofile-udevinput b/udev/input/xprofile-udevinput new file mode 100755 index 0000000..9664326 --- /dev/null +++ b/udev/input/xprofile-udevinput @@ -0,0 +1,7 @@ +#!bin/sh +# Load this script whenever a USB keyboard is attached + +xset r rate 200 60 + +# Barrier needs this on client and server side +setxkbmap -device `xinput list --id-only "Virtual core XTEST keyboard"` de diff --git a/udev/input/xprofile-udevinput-monitor b/udev/input/xprofile-udevinput-monitor new file mode 100755 index 0000000..e48d1ac --- /dev/null +++ b/udev/input/xprofile-udevinput-monitor @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +# For each add-event of input subsystem by udev call ~/.xprofile-keyboard +udevadm monitor -u -s input | grep --line-buffered add | while read line; do + echo ">> $line"; + sh ~/.xprofile-udevinput +done + diff --git a/udev/input/xprofile-udevinput-monitor.service b/udev/input/xprofile-udevinput-monitor.service new file mode 100644 index 0000000..09725fb --- /dev/null +++ b/udev/input/xprofile-udevinput-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=xprofile-udevinput-monitor daemon +After=multi-user.target + +[Service] +Environment=DISPLAY=:0 +ExecStart=%h/.local/bin/xprofile-udevinput-monitor +Restart=always +RestartSec=10min + +[Install] +WantedBy=default.target