Skip to content

Instantly share code, notes, and snippets.

@zxh
Created December 23, 2012 10:22
Show Gist options
  • Save zxh/4362837 to your computer and use it in GitHub Desktop.
Save zxh/4362837 to your computer and use it in GitHub Desktop.
Linux下设置trackpoint的属性
小红帽是tp的一大利器。在ubuntu下速度慢。
先查看一下设备的属性:
udevadm test /sys/devices/platform/i8042/serio1/serio2
在最后有:
ACTION=add
DEVPATH=/devices/platform/i8042/serio1/serio2
DRIVER=psmouse
MODALIAS=serio:ty05pr00id00ex00
SERIO_EXTRA=00
SERIO_ID=00
SERIO_PROTO=00
SERIO_TYPE=05
SUBSYSTEM=serio
UDEV_LOG=6
USEC_INITIALIZED=651946591
run: '/sbin/modprobe -bv serio:ty05pr00id00ex00'
注意:不同设备的属性值可能不同。路径也可能不同。
然后是写udev的rules,在/etc/udev/rules.d里添加一个规则文件,比如叫做10-trackpoint.rules。内容:
SUBSYSTEM=="serio", DRIVERS=="psmouse", ENV{SERIO_TYPE}=="05", WAIT_FOR="/sys/devices/platform/i8042/serio1/serio2/sensitivity", ATTR{sensitivity}="156", ATTR{speed}="255"
这一条的意思是如果匹配到了前面三条,并且wait_for的文件出现,那么就给后面两个属性赋值。
重启,生效。
=========================================================================================================
有其他方法:
# echo -n 120 > /sys/devices/platform/i8042/serio1/serio2/speed
# echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
这个操作一定要拥有root权限,如果只是sudo的话只能提升echo的权限,然后就会因为重导向(redirection)的权限不足而无法修改。相比你一定不会满足于每次启动都使用root权限运行这两行指令,那么如何自动在启动时候修改这两个值就是一个问题:放在rc.local中?有些人成功了,而大多数人都失败了,原因是rc.local执行的时候小红点还没有被检测到,所以所有操作都变成了徒劳。
如果有兴趣:
http://reactivated.net/writing_udev_rules.html
http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint#Sensitivity_.26_Speed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment