How to run sudo .sh file after wakeup : Touchpad disabled after upgrading to Ubuntu 17.10
Solution 1:
To automate the call to your script on wakeup, you can add it under /lib/systemd/system-sleep
instead of /usr/lib/pm-utils/sleep.d
Here is what I've done:
sudo touch /lib/systemd/system-sleep/touchpadwakeup
- Put the following content:
#!/bin/sh case $1 in post) rmmod i2c_hid modprobe i2c_hid ;; esac
sudo chmod +x /lib/systemd/system-sleep/touchpadwakeup
It works fine but I hope we'll have a cleaner solution (e.g, a patch) in the near future.
Solution 2:
There is discussion and another one solution of this bug here ( in three words: use upstream kernel 4.13.7-041307-generic )
BTW, could you push "This bug affects me" green link on that page, so developers fix it faster. It's really annoying to reload kernel module every time after suspend.