# 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}=="1a40", ATTRS{idProduct}=="0101", RUN+="/usr/local/bin/kvm-udev-trigger.sh"