blob: d1e6ec13866d2b8a3f76099832e22e1a4839813b (
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}=="04b3", ATTRS{idProduct}=="301b", RUN+="/usr/local/bin/kvm-udev-trigger.sh"
|