Sleep resume in Ubuntu screws up mouse pad

I found that my Lenovo laptops did not always get the mousepad right when coming out of sleep or hibernate. After a bit of research I found that a modprobe remove and insert of the psmouse kernel module did the trick.

To automatize this you can insert a file in the systemd control structore to fix the problem yourself (if you are experiencing it).

Below is a block of code. Save this to a file in /lib/systemd/system-sleep/touchpad


#!/bin/bash
# 2019 Täpp-Anders Sikvall
# Reinsert kernel module for mouse pad on lenovo after waking up
# from a sleep or a suspend so that things like gestures work
# properly
# bugs to anders@sikvall.se

case "$1" in
pre)
exit 0 # Do nothing just return
;;
post)
sleep 3 # Wait for system to stabilize
modprobe -r psmouse # Remove psmouse from kernel
modprobe psmouse # Reinsert psmouse to kernel
exit 0 # Return no error
;;
*)
exit 1 # Normally we should not be here
;; # but if we are, return error
esac

Lämna ett svar

E-postadressen publiceras inte. Obligatoriska fält är märkta *

Denna webbplats använder Akismet för att minska skräppost. Lär dig hur din kommentardata bearbetas.