Sample Header Ad - 728x90

Trying to disable the touchpad at wakeup

0 votes
1 answer
302 views
I am using a Thinkpad L13 Yoga and had the problem that the trackpoint stopped working after wakeup. So I followed the following hint (which basically reloads the psmouse module at wakeup): https://askubuntu.com/a/1159960/270792 After putting the file in place the trackpoint stopped failing at wakeup, however, the touchpad now was activated. I would like, however, to keep the touchpad deactivated since I sometimes touch it with my palms unintentionally. So i tried to disable the touchpad at wakeup. Here is how my /lib/systemd/system-sleep/trackpoint-fix script currently looks like:
#!/bin/bash

case $1/$2 in
  pre/*)
    echo "Going to $2..."
    # Place your pre suspend commands here, or exit 0 if no pre suspend action required
    modprobe -r psmouse
    ;;
  post/*)
    echo "Waking up from $2..."
    # Place your post suspend (resume) commands here, or exit 0 if no post suspend action required
    sleep 2
    echo "Will now modprobe psmouse..."
    modprobe psmouse
    sleep 2
    echo "Will now disable the touchpad..."
    DISPLAY=:0 xinput disable 'Elan Touchpad'
    sleep 2
    echo "Will now show touchpad state..."
    DISPLAY=:0 xinput list-props 'Elan Touchpad' | grep 'Device Enabled'
    ;;
esac
This is what I find in my logs:
Mai 24 15:13:42 ThinkpadL13Yoga systemd-sleep: Going to suspend...
Mai 24 15:13:42 ThinkpadL13Yoga systemd-sleep: Suspending system...
Mai 24 15:13:50 ThinkpadL13Yoga systemd-sleep: System resumed.
Mai 24 15:13:50 ThinkpadL13Yoga systemd-sleep: Waking up from suspend...
Mai 24 15:13:52 ThinkpadL13Yoga systemd-sleep: Will now modprobe psmouse...
Mai 24 15:13:54 ThinkpadL13Yoga systemd-sleep: Will now disable the touchpad...
Mai 24 15:13:56 ThinkpadL13Yoga systemd-sleep: Will now show touchpad state...
Mai 24 15:13:56 ThinkpadL13Yoga systemd-sleep:         Device Enabled (184):        0
So, looking at the last line, it seems like the touchpad device has been disabled successfully. However, the touchpad is still active. If I check the state of the touchpad inside the X session after wakeup, it tells me that the device is indeed enabled:
$ DISPLAY=:0 xinput list-props 'Elan Touchpad' | grep 'Device Enabled'
	Device Enabled (184):	1
I absolutely don't understand how the touchpad gets enabled again and would like to keep it disabled. Possibly, reloading psmouse isn't a suiting solution and there is a better approach to keep the trackpoint enabled after wakeup.
Asked by Photon (119 rep)
May 24, 2021, 01:49 PM
Last activity: Aug 14, 2021, 06:03 PM