Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #add new rule
- sudo vim /etc/udev/rules.d/01_gamepad.rules
- ATTRS{idVendor}=="<vendor ID>", ATTRS{idProduct}=="<product ID>", RUN+="/usr/local/bin/<script to run>"
- #to get vendor and product id
- lsusb
- #example output
- Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
- Bus 001 Device 008: ID 045e:028e Microsoft Corp. Xbox360 Controller
- Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
- #example Xbox360 vender=045e product=028e
- #another way without lsusb
- cat /proc/bus/input/devices
- #example output
- I: Bus=0003 Vendor=045e Product=028e Version=0110
- N: Name="Microsoft X-Box 360 pad"
- P: Phys=usb-0000:00:1a.0-1.5/input0
- S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.5/1-1.5:1.0/input/input37
- U: Uniq=
- H: Handlers=event23 js0
- B: PROP=0
- B: EV=20000b
- B: KEY=7cdb000000000000 0 0 0 0
- B: ABS=3003f
- B: FF=107030000 0
- ##after adding rule restart udevadm##
- sudo udevadm control --reload
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement