Configuring Trackpoint on the Lenovo Thinkpad
This is more or less just a post for myself. I always end up dumping a couple of hours into this problem whenever I get a new machine for work -- surprise! I work for Docker now -- and tonight especially I really could have used this post instead of wasting that time researching the problem all over again. I choose Thinkpads when I have a choice, because the popular alternative is stupid.
Anyway, I use Linux Mint with Cinnamon, and LM18 is the current version. It's based on Ubuntu 16.04. I've chosen a P50 and upgraded the RAM to 64GB. Everything works out of the box, including the weird dual graphics situation going on under the hood. However, I want a super sensitive Trackpoint. The sensitivity settings are under something like /sys/devices/platform/i8042/serio1/serio2/
in the sensitivity
, speed
and inertia
files. I like to keep mine at about 255
, 230
, and 4
, respectively. The value of 255
is maximal, btw.
Now, simply dumping my preferences into those files works for the current session. Meaning, when I reboot the machine, they are reset to their defaults. So I'm using systemd to write values into these files on boot. I've got a /etc/tmpfiles.d/tpoint.conf
file with the following contents:
w /sys/devices/platform/i8042/serio1/serio2/speed - - - - 230
w /sys/devices/platform/i8042/serio1/serio2/sensitivity - - - - 255
w /sys/devices/platform/i8042/serio1/serio2/inertia - - - - 4
Now, this works great. However, after I resume (or thaw) from a suspend (or hibernate), the location of these config files changes. So what I've done is added a simple shell script to /etc/pm/sleep.d/trackpoint-fix
which contains the following:
#!/bin/bash
# set sensitivity/speed of trackpoint on resume
case "${1}" in
suspend|hibernate)
# suspending to RAM
sleep 0
;;
resume|thaw)
# resume from suspend
newdir=$(find /sys/devices/platform/ | grep sensitivity | sed -e "s/sensitivity//")
echo 230 | sudo tee > ${newdir}speed
echo 255 | sudo tee > ${newdir}sensitivity
echo 4 | sudo tee > ${newdir}inertia
;;
esac
This is pretty self-explanatory. I dig around for the new location of these configuration files and then dump my favorite values into them. That's all there is to it.