Thinkpad大概是對(duì)Linux支持最好的筆記本了别垮,Ubuntu大概是對(duì)硬件支持最好的Linux發(fā)行版了。Ubuntu16.04已經(jīng)可以支持最新的2016年的Thinkpad X1 Carbon的CPU,但是還是有些安裝后的設(shè)置要做,比如小紅點(diǎn)。Ubuntu下并沒(méi)有默認(rèn)的對(duì)小紅點(diǎn)Trackpoint的設(shè)置界面醒第,所以小紅點(diǎn)加速很慢,使用十分辛苦进鸠。
修改加速設(shè)置也很簡(jiǎn)單淘讥,首先在終端下取得小紅點(diǎn)的ID:
$ xinput list | grep TrackPoint
TPPS/2 IBM TrackPoint id=14 [slave pointer (2)]
我的X1c上小紅點(diǎn)的輸入ID是14。
然后獲得該ID的設(shè)置:
$ xinput list-props 14
Device 'TPPS/2 IBM TrackPoint':
Device Enabled (137): 1
Coordinate Transformation Matrix (139): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
Device Accel Profile (263): 0
Device Accel Constant Deceleration (264): 1.000000
Device Accel Adaptive Deceleration (265): 1.000000
...
輸出結(jié)果第5堤如、6行就是關(guān)于小紅點(diǎn)加速的設(shè)置:
...
Device Accel Constant Deceleration (264): 1.000000
Device Accel Adaptive Deceleration (265): 1.000000
...
其中括號(hào)里的整數(shù)就是該項(xiàng)設(shè)置的ID蒲列,后面的小數(shù)是該項(xiàng)設(shè)置的參數(shù)值。ID為264(我的機(jī)器)代表的是小紅點(diǎn)的固定阻力值(Constant Deceleration)搀罢,取值范圍是 [0,1]蝗岖;ID為265代表的是隨力度減弱時(shí)阻力增加的速度,即小紅點(diǎn)停下來(lái)的速度榔至,取值范圍是 [1,?]抵赢。一般來(lái)說(shuō)設(shè)置264就夠了:
$ xinput set-prop 14 264 0.25
即把ID為14(小紅點(diǎn))的設(shè)備的ID為264(阻力)設(shè)置為0.25。
把這條命令加入到 ~/.xprofile 或者其它啟動(dòng)運(yùn)行的命令里就好了。當(dāng)然還可以寫(xiě)個(gè)完整的shell腳本來(lái)運(yùn)行上面的一切:
#!/bin/bash
# obtain TrackPoint ID from xinput list
TP_ID=$(xinput list | grep TrackPoint | cut -f 2 | grep -Eo '[0-9]{1,}')
if [ -n "$TP_ID" ]; then
# obtain properties from xinput list-props "$TP_ID"
AS_ID=$(xinput list-props "$TP_ID" | grep 'Accel Constant Deceleration (' | cut -f 2 | grep -Eo '[0-9]{1,}')
# set the speed you want
xinput set-prop "$TP_ID" "$AS_ID" 0.25
fi
現(xiàn)在小紅點(diǎn)又可以流暢的用起來(lái)啦~