aboutsummaryrefslogtreecommitdiff
path: root/kvm-input.rules
blob: 1fe73dd07ff5955bd920f360978e84ffcfb30266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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}=="1a40", ATTRS{idProduct}=="0101", RUN+="/usr/local/bin/kvm-udev-trigger.sh"
bgstack15