LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Laptop and Netbook (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/)
-   -   Reconnecting Trackpad on wake up from sleep (https://www.linuxquestions.org/questions/linux-laptop-and-netbook-25/reconnecting-trackpad-on-wake-up-from-sleep-4175662264/)

sniff 10-09-2019 05:35 AM

Reconnecting Trackpad on wake up from sleep
 
Dear all,

I have laptop that is mostly great with Ubuntu but sometimes when it wakes from sleep the mouse buttons above the trackpad don't work.

Its a Lenovo Thinkpad X1 Carbon (6th gen with the high res screen).

To get it to work again I run the following little script.

Code:

#!/bin/bash
echo -n "none" | sudo tee /sys/bus/serio/devices/serio1/drvctl
echo -n "reconnect" | sudo tee /sys/bus/serio/devices/serio1/drvctl

I tried putting this in a pam utils script, below, but it doesn't work. Anyone know where I might have gone wrong?

I put it here /usr/lib/pm-utils/sleep.d/95-trackpad

Code:

#!/bin/bash
#reconnects trackpad after sleep

. "${PM_FUNCTIONS}"

case "$1" in
    resume|thaw)
        echo -n "none" | sudo tee /sys/bus/serio/devices/serio1/drvctl
        echo -n "reconnect" | sudo tee /sys/bus/serio/devices/serio1/drvctl
    *) exit $NA
      ;;
esac

exit 0


teckk 10-10-2019 11:37 AM

You are missing ;; on resume|thaw)

sniff 10-10-2019 03:17 PM

Oooo, I am indeed. I hope that is it. :)

sniff 10-10-2019 03:52 PM

So, figured it out. I was missing the ;; but also it was in the wrong place.

My script needed to be in /lib/systemd/system-sleep/ and the script is below with a quick thing to check it is running which can be removed.

Code:

#!/bin/bash
#reconnects trackpad after sleep

case "$1" in
    post)
        echo -n "none" | tee /sys/bus/serio/devices/serio1/drvctl
        echo -n "reconnect" | tee /sys/bus/serio/devices/serio1/drvctl
        echo "ran2" >> /var/log/track.log
        ;;
esac



All times are GMT -5. The time now is 10:19 AM.