jakob wrote:this does not apply at boot time on my system. Anybody else having different results?
Same here. It looks like a different tackpoint model alltogether (T420 here).
The problem also is not that this would not apply at boot time, it's more that the trackpoint is not fully ready when it gets advertised in sysfs.
What worked for me:
ACTION=="add",DEVPATH=="/devices/platform/i8042/serio4/serio5",ATTR{sensitivity}="128",ATTR{speed}="200"
Hope this helps. Make sure DEVPATH leads to your trackpoint device.
]]>this does not apply at boot time on my system. Anybody else having different results?
Same here. It looks like a different tackpoint model alltogether (T420 here).
The problem also is not that this would not apply at boot time, it's more that the trackpoint is not fully ready when it gets advertised in sysfs.
]]>Hello,
I have the following udev rule in my 10-trackpoint.rule
ACTION=="add",SUBSYSTEM=="input",ATTR{name}=="TPPS/2 IBM TrackPoint",ATTR{device/sensitivity}="200",ATTR{device/speed}="120"
Thanks for sharing your idea!
However, this does not apply at boot time on my system. Anybody else having different results?
]]>I have the following udev rule in my 10-trackpoint.rule
ACTION=="add",SUBSYSTEM=="input",ATTR{name}=="TPPS/2 IBM TrackPoint",ATTR{device/sensitivity}="200",ATTR{device/speed}="120"
and everything works like a charm.
Hope this works for you to
]]>Cheers,
Jeroen
Nice fix Jakob!
My conputer was however still booting up too fast for the trackpoint to have advertised it's attributes so I added
ExecStartPre=/usr/bin/sleep 5
to the [Service] part of the unit file.
This does not seem to negatively affect the boot speed of my computer (although I must admit that it takes a while to type my password when ssh-agent launches on startup.
Hey jeroen, thanks for your addition! I also sometimes notice that the service gets executed normally while at other times it doesn't. But as I use my thinkpad in the docking station most of the time with an external keyboard and mouse, I haven't been forced to fix this properly yet. Your solution seems like an elegant hack.
One question though. Why are you running that ExecStartPost command?
This is merely to directly have the result of ExecStart as output in journalctl and directly be able to see ther whether it worked or not.
]]>My conputer was however still booting up too fast for the trackpoint to have advertised it's attributes so I added
ExecStartPre=/usr/bin/sleep 5
to the [Service] part of the unit file.
This does not seem to negatively affect the boot speed of my computer (although I must admit that it takes a while to type my password when ssh-agent launches on startup.
Judging from the PID's, enough stuff gets done while wainting for sleep to finish.
$ sudo systemctl status trackpoint-reload-udev.service
● trackpoint-reload-udev.service - Activate udev rule 10-thinkpad.rules
Loaded: loaded (/etc/systemd/system/trackpoint-reload-udev.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Tue 2015-09-15 00:30:22 CEST; 11min ago
Process: 613 ExecStartPost=/usr/bin/udevadm info -a -p /sys/devices/platform/i8042/serio1/serio2/ (code=exited, status=0/SUCCESS)
Process: 609 ExecStart=/usr/bin/udevadm trigger --subsystem-match=serio (code=exited, status=0/SUCCESS)
Process: 417 ExecStartPre=/usr/bin/sleep 5 (code=exited, status=0/SUCCESS)
Main PID: 609 (code=exited, status=0/SUCCESS)
Sep 15 00:30:22 zechs udevadm[613]: looking at parent device '/devices/platform/i8042':
Sep 15 00:30:22 zechs udevadm[613]: KERNELS=="i8042"
Sep 15 00:30:22 zechs udevadm[613]: SUBSYSTEMS=="platform"
Sep 15 00:30:22 zechs udevadm[613]: DRIVERS=="i8042"
Sep 15 00:30:22 zechs udevadm[613]: ATTRS{driver_override}=="(null)"
Sep 15 00:30:22 zechs udevadm[613]: looking at parent device '/devices/platform':
Sep 15 00:30:22 zechs udevadm[613]: KERNELS=="platform"
Sep 15 00:30:22 zechs udevadm[613]: SUBSYSTEMS==""
Sep 15 00:30:22 zechs udevadm[613]: DRIVERS==""
Sep 15 00:30:22 zechs systemd[1]: Started Activate udev rule 10-thinkpad.rules.
One question though. Why are you running that ExecStartPost command?
One happy camper here
]]>[Unit]
Description=Activate udev rule 10-thinkpad.rules
[Service]
Type=oneshot
ExecStart=/usr/bin/udevadm trigger --subsystem-match=serio
ExecStartPost=/usr/bin/udevadm info -a -p /sys/devices/platform/i8042/serio1/serio2/
[Install]
WantedBy=multi-user.target
Put this into a file called /etc/systemd/system/press-to-select.service and activate it by
sudo systemctl enable press-to-select.service
and you should be set.
For the record, here is my /etc/udev/rules.d/10-trackpoint.rules file:
KERNEL=="serio2", SUBSYSTEM=="serio", DRIVER=="psmouse", ATTR{press_to_select}="1", ATTR{ztime}="15", ATTR{sensitivity}="180"
edit: I refined the service file a bit in order to trigger udev for serio subsystem only.
]]>#!/bin/bash
# When run from a udev rule, DEVPATH should be set
if [ ! -z $DEVPATH ] ; then
TPDEV=/sys/$( echo "$DEVPATH" | sed 's/\/input\/input[0-9]*//' )
else
# Otherwise just look in /sys/
TPDEV=$(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//')
fi
if [ -d "$TPDEV" ]; then
for i in {0..10}; do
if [ -f "$TPDEV/speed" ]; then
echo "Configuring Trackpoint"
echo -n 200 > $TPDEV/sensitivity
echo -n 130 > $TPDEV/speed
echo -n 20 > $TPDEV/drift_time
exit 0;
fi
sleep 1
done
echo "Couldn't find attributes"
exit 1
else
echo "Couldn't find trackpoint device $TPDEV"
exit 2
fi
It usually takes 6 seconds.
]]>@mhshams
It might work, but it's ugly as hell. We have systemd, systemd will save the world. Uhm… I keep believing.¹
________
¹ For real. I like most of the concepts of systemd and I wonder why there's this sluggish behavior with my service.
Check for this:
To avoid the wait you can also listen for the Trackpoint input device to appear and then run a script to set the parameters
SUBSYSTEM=="input", ATTR{name}=="*TrackPoint*", RUN+="/etc/conf.d/trackpoint"
An example /etc/conf.d/trackpoint would be
#! /bin/bash
## Trackpoint settings
# When run from a udev rule, DEVPATH should be set
if [ ! -z $DEVPATH ] ; then
TPDEV=/sys/$( echo "$DEVPATH" | sed 's/\/input\/input[0-9]*//' )
else
# Otherwise just look in /sys/
TPDEV=$(find /sys/devices/platform/i8042 -name name | xargs grep -Fl TrackPoint | sed 's/\/input\/input[0-9]*\/name$//')
fi# http://www.thinkwiki.org/wiki/How_to_co … TrackPoint
# http://wwwcssrv.almaden.ibm.com/trackpo … t3eext.pdf
#------------------------------------------------------------
if [ -d "$TPDEV" ]; then
echo "Configuring Trackpoint"
echo -n 255 > $TPDEV/sensitivity # Integer 128 Sensitivity
echo -n 110 > $TPDEV/speed # Integer 97 Cursor speed
echo -n 4 > $TPDEV/inertia # Integer 6 Negative intertia
else
echo "Couldn't find trackpoint device $TPDEV"
fi
edit: Actually this issue was called a bug years ago: http://www.thinkwiki.org/wiki/How_to_co … d_Speed.29
There's also a script that should work without the WAIT_FOR, but I don't know if that's really the case. That's more or less exactly the same what the service unit would do – and it fails without a "sleep 7".
@SammysHP: Is tagging even possible? My device path changes sometimes. Even worse: Sometimes I need to manually run “modprobe -r psmouse; modprobe psmouse”, because the trackpoint is not working. Without a stable device path I see no possibility to let a systemd service unit depend on the proper systemd device unit.
It might be possible to use a udev RUN hook in the meantime. The script would need to wait a short period of time before setting the attributes. I have not tested it yet, though.
]]>