You are not logged in.

#1 2017-06-30 16:37:28

pegarrett
Member
From: Dublin, OH
Registered: 2017-06-30
Posts: 1

Setting Trackpoint Speed/Sensitivity at Startup

I have a Lenovo Thinkpad P51s. I want to set my preferred speed and sensitivity for the trackpoint at startup.

I followed the guide here: https://wiki.archlinux.org/index.php/Tr … .path_unit

First I created the following script:

/usr/local/bin/trackpoint_config.sh

echo -n 143 > /sys/devices/platform/i8042/serio1/serio2/sensitivity
echo -n 223 > /sys/devices/platform/i8042/serio1/serio2/speed

I set the permissions for the script:

$ chmod 755 trackpoint_config.sh

I created the following .path systemd unit:

/etc/systemd/system/trackpoint_parameters.path

[Unit]
Description=Watch for, and modify, Trackpoint attributes

[Path]
PathExists=/sys/devices/platform/i8042/serio1/serio2/sensitivity
PathExists=/sys/devices/platform/i8042/serio1/serio2/speed

[Install]
WantedBy=default.target

I set the permissions for the .path systemd unit:

$ chmod 755 trackpoint_parameters.path

I then created the following .service systemd unit:

/etc/systemd/system/trackpoint_parameters.service

[Unit]
Description=Set TrackPoint attributes

[Service]
ExecStart=/usr/local/bin/trackpoint_config.sh

I set the permissions for the .service systemd unit:

$ chmod 755 trackpoint_parameters.service

I enabled and started the .path systemd unit:

$ systemctl enable trackpoint_parameters.path
$ systemctl start trackpoint_parameters.path

I enabled and started the .service systemd unit:

$ systemctl enable trackpoint_parameters.service
$ systemctl start trackpoint_parameters.service

The script works if I invoke it manually but it does not work automatically at startup.

I have spent the past two weeks off and on trying to find a solution to this issue, but I have come up empty.

Can anyone point me in the right direction for solving this issue?

Last edited by pegarrett (2017-06-30 17:22:54)

Offline

#2 2017-07-01 04:03:55

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: Setting Trackpoint Speed/Sensitivity at Startup

Does it work if you start the systemd unit manually? If yes, then it could be some race condition. Maybe try adding some delay in your script and see if that helps.

Offline

#3 2017-07-05 20:29:14

Levenal
Member
From: The United Kingdom
Registered: 2017-07-05
Posts: 3

Re: Setting Trackpoint Speed/Sensitivity at Startup

I can give you my workaround solution, and you can try and implement it into your Thinkpad (since it has worked for mine).  The first step is to create something called a 'udev rule'.

Create this file and add the below contents:

/etc/udev/rules.d/10-trackpoint.rules 

ACTION=="add", KERNEL=="serio2", SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTR{sensitivity}="250", ATTR{speed}="250"

Now, you can check if this will work by trying the following commands:

udevadm control --reload
udevadm test /sys/devices/platform/i8042/serio1/serio2

If they reset the trackpoint speed, then we can proceed.


Next, create this script and make it executable (by root I think):

usr/local/bin/mybootscript.sh 


#!/bin/sh

sleep 2
udevadm control --reload
udevadm test /sys/devices/platform/i8042/serio1/serio2


Now create the following service:

/etc/systemd/system/bootscript.service


[Unit]
Description=Bootup script

[Service]
ExecStart=/usr/local/bin/mybootscript.sh

[Install]
WantedBy=multi-user.target

Start the service:

systemctl enable bootscript.service

Now, a reboot should result in your trackpoint speed being set a couple of seconds after loading.  What I think this does is set a udev rule, and then triggers a reset of certain udev rules, effectively refreshing them and updating your trackpoint speed in the process.  My suspicion is that if the trackpoint speed is altered too early on in the boot process, then it gets overriden or ignored somehow.  It does feel an incredibly overcomplicated way of simply altering trackpoint speed smile




NOTE FOR ANYONE WITH LXDM DISPLAY MANAGER

You can just edit the  following file like so:

/etc/lxdm/PreLogin 


#!/bin/sh
#
# Note: this is a sample and will not be run as is.

#Speed up trackpoint
echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/speed
echo -n 250 > /sys/devices/platform/i8042/serio1/serio2/sensitivity

This is run as root before login, and so will change the speed after a successful login.  (This is how I do it now)


“All you need is ignorance and confidence, and the success is sure.”    "The game taught me the game.  And it didn't spare me the rod while teaching."   "Star Wars is awesome."

Offline

Board footer

Powered by FluxBB