aboutsummaryrefslogtreecommitdiff
path: root/kvm-input.rules
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-01-11 15:31:41 -0500
committerB. Stack <bgstack15@gmail.com>2023-01-11 15:31:41 -0500
commit5664ccbff51c98db034243070032044fd90637b9 (patch)
tree854e9440b76500771111d8b35d749b546bf7b0bd /kvm-input.rules
downloadkvm-mapping-5664ccbff51c98db034243070032044fd90637b9.tar.gz
kvm-mapping-5664ccbff51c98db034243070032044fd90637b9.tar.bz2
kvm-mapping-5664ccbff51c98db034243070032044fd90637b9.zip
initial commit
Diffstat (limited to 'kvm-input.rules')
-rw-r--r--kvm-input.rules20
1 files changed, 20 insertions, 0 deletions
diff --git a/kvm-input.rules b/kvm-input.rules
new file mode 100644
index 0000000..d1e6ec1
--- /dev/null
+++ b/kvm-input.rules
@@ -0,0 +1,20 @@
+# File: /etc/udev/rules.d/kvm-input.rules
+# Location: vm2
+# Author: bgstack15
+# Startdate: 2023-01-11-4 11:18
+# Title: Udev rule for detecting kvm switched input
+# Project: kvm-mapping
+# Purpose: run script when my USB keyboard is plugged in, i.e., when the kvm is switched to this output
+# History:
+# Usage:
+# After making changes: `sudo udevadm control --reload`
+# Reference:
+# IBM Corp. SK-8815 keyboard that is on my USB kvm
+# lsusb
+# https://superuser.com/questions/305723/using-udev-rules-to-run-a-script-on-usb-insertion
+# Improve:
+# Documentation:
+# This invokes the script three times, so the trigger script must look for DEVTYPE="usb_device" because I couldn't find a way to do that here with an ATTRS
+# Dependencies:
+# /usr/local/bin/kvm-udev-trigger.sh
+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="04b3", ATTRS{idProduct}=="301b", RUN+="/usr/local/bin/kvm-udev-trigger.sh"
bgstack15