0

I am having a problem where 2 finger scrolling stops working after suspend. After a reboot it works fine again. I am running a Dell Inspiron 5515. I've gone through the forums where similar problems were discussed and tried the recommended fixes but nothing worked for me. I am new to Ubuntu and not very technical but I can follow instruction to paste commands into a terminal or edit files etc. Thanks in advance for any help or suggestions.

Jack
  • 1
  • Does it start working again after logging out and back in without rebooting? – Daniel T Jan 28 '24 at 14:32
  • No it doesn't. Any other suggestions? – Jack Jan 28 '24 at 14:37
  • I have found that after entering the following command in terminal the touchpad starts working again. "sudo modprobe -r hid-multitouch && sudo modprobe hid-multitouch" is there a way this can be automated? – Jack Jan 29 '24 at 14:21
  • The clean way to listen for system resume is to use https://askubuntu.com/a/1318782 . The sudo and the wantedby lines in your service example look weird. Probably you want to put the "modprobe -r" part at the suspend, and the "modprobe" part at the resume – Daniel T Jan 29 '24 at 22:57
  • The good news is it works. Problem solved. – Jack Jan 31 '24 at 23:49

2 Answers2

0
  1. Create a systemd service file: $ sudo nano /etc/systemd/system/resume-commands.service

  2. Add the following lines to the file:


[Unit]
Description=Run custom commands on resume
After=suspend.target

[Service] Type=simple ExecStart=/bin/bash -c "sudo modprobe -r hid-multitouch && sudo modprobe hid-multitouch"

[Install] WantedBy=suspend.target

  1. Save the file and close the editor.
  2. Reload the systemd manager configuration:
$ sudo systemctl daemon-reload
  1. Enable the service to run on system startup:
$ sudo systemctl enable resume-commands.service
  1. Reboot your system to apply the changes.
user68186
  • 33,360
Jack
  • 1
0

Create a file as
sudo vi /lib/systemd/system-sleep/tp-reset

Add the following lines to the file

#!/bin/bash

if [ "${1}" = "pre" ]; then

Do the thing you want before suspend here

echo "pre" elif [ "${1}" = "post" ]; then

Do the thing you want after resume here

/usr/sbin/rmmod hid_multitouch && /usr/sbin/modprobe hid_multitouch fi

Make it executable
sudo chmod +x /lib/systemd/system-sleep/tp-reset