Etikettarkiv: sleep

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 structure 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



case "$1" in
    #code execution BEFORE sleeping/hibernating/suspending
    # unload touchpad driver
	/usr/sbin/modprobe -r psmouse
    #code execution AFTER resuming
    # reload touchpad driver
	/usr/sbin/modprobe psmouse

exit 0