I'm trying to run a script when my mouse connects.
#!/bin/sh
echo New mouse speed applied
id=17
speed=1
xinput set-prop $id "Coordinate Transformation Matrix" $speed, 0, 0, 0, $speed, 0, 0, 0, 1
firefox #Starting this so I'll see instantly if it worked
The udev rule:
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idProduct}=="0405", ATTRS{idVendor}=="145f", RUN+="/home/matthes/.mousespeed.sh"
The script works, I tested it manually.
$ udevadm info -a -p /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3:1.1/0003:145F:0405.001A/input/input43/mouse4
looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-3':
KERNELS=="1-3"
SUBSYSTEMS=="usb"
[...]
ATTRS{idProduct}=="0405"
ATTRS{idVendor}=="145f"
[...]
ATTRS{product}=="Trust Gaming Mouse"
[...]
idProduct and idVendor are correct too, I can't figure out why it won't work. Thanks for any help!
xinput
can't connect to a running xserverxorg.conf
, could you add prop listing of that device from xinput.