当我的鼠标连接时,我尝试运行一个脚本。
#!/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
udev 规则:
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idProduct}=="0405", ATTRS{idVendor}=="145f", RUN+="/home/matthes/.mousespeed.sh"
该脚本有效,我手动测试了它。
$ 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 和 idVendor 也正确,我不明白为什么它不起作用。谢谢您的帮助!