4

I am using Ubuntu 18.04 running on lenovo carbon yoga x1 (1st Gen). Everything work fine most of the time, but after I put the computer to suspend and then wake it up in the am, the mouse goes a little whack: - the left click of the mouse doesn't work. - the sliding lock screen for example looks like it's stuck in drag mode, I can slide up and down but not all the way, and I have to power cycle the machine to get to the login box.

  • Read man pm-action to see what steps your system goes through when you suspend/resume. If you find a fix, this is where it would go. What do lsusb and sudo lshw tell you about your mouse? – waltinator Jul 13 '18 at 06:14
  • I ran both commands and read the man, I'm not sure how that helps. Happy to share the output. After suspend / hybernaite, I actaully have to reboot twice until the mouse comes back to normal work... – Dory Zidon Jul 13 '18 at 11:42
  • How am I suppose to fix this? I'm really unsure.. – Dory Zidon Jul 13 '18 at 11:42
  • @waltinator happy to follow your instructions. – Dory Zidon Jul 13 '18 at 11:43

2 Answers2

12

Faced this problem today and this is what worked for me.

Make sure your device module is psmouse by running,

lsmod | grep psmouse

if its not, find the relavant module name.

$ cd /lib/systemd/system-sleep/
$ sudo vi fixtouchpad

then paste and save the following

#!/bin/bash
[ "$1" = "post" ] && exec modprobe psmouse
[ "$1" = "pre" ] && exec rmmod psmouse
exit 0

This will reload your psmouse module after resuming. Replace 'psmouse' with your module name.

Be sure to make the script executable

sudo chmod +x fixtouchpad
abu_bua
  • 10,783
imeshU
  • 129
  • Worked for my Fujitsu Lifebook running Ubuntu 18.04.3; it still hangs for a few seconds after standby - but it finally reacts to user input again without crazy behaviour! Thank's for this solution! – SDwarfs Dec 28 '19 at 02:53
  • work for me at asus zenbook 13 on xubntu 20.04 Thanks! – sadalsuud Jun 15 '21 at 22:04
  • This does not work with 20.04+logitech mouse on XPS13 (2019). – Tom May 23 '22 at 13:36
2

I was having similar issues with 18.04 and they actually got worse since upgrading to 18.10. I have a Logitech "unifying receiver" that has both a mouse and keyboard paired with it. When resuming from sleep, fairly often either the mouse or the keyboard no longer work. I don't remember suffering these issues with 17.10...

The following script fixed it for me:

for mod in hid_logitech_hidpp hid_logitech_dj usbhid; do
   sudo rmmod $mod && sleep 3
   sudo modprobe $mod
done

If you create a script with this, don't forget to make it executable, eg with chmod +x $HOME/fix_logitech.sh

(not sure what the various modules are for but they looked like good candidates). I used my laptop's integrated keyboard to type this. If the approach works, I might consider @imeshU's approach to hook this into the System-D sleep/resume process.

sxc731
  • 1,134
  • So, did this work. As of late it says usbhid is a built in module and won't touch it. Script also doesn't seem to work on kernel 6. Won't let it be rmmod'd. – Rig Dec 31 '23 at 01:53