Created
June 15, 2022 06:11
-
-
Save SwagDevOps/e1d580ca0334a345d0e86a30285a0fdd to your computer and use it in GitHub Desktop.
Touchpad not working after suspending laptop (MaxBook Y13 Pro - BMAX)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # @file /lib/systemd/system-sleep/touchpad | |
| # @see https://askubuntu.com/questions/671910/touchpad-not-working-after-suspending-laptop | |
| set -eu | |
| # constants ---------------------------------------------------------- | |
| MODULES="i2c_hid_acpi" | |
| RETCODE=0 | |
| # functions ---------------------------------------------------------- | |
| reload() { | |
| for module in $@; do | |
| /usr/sbin/lsmod | grep -Eq "^${module}\s+" ||: | |
| /sbin/modprobe -srv "$module" || { | |
| RETCODE=1 | |
| continue | |
| } | |
| /sbin/modprobe -sv "$module" | |
| done | |
| } | |
| # execution ---------------------------------------------------------- | |
| case "${1:-}" in | |
| post) | |
| reload $MODULES | |
| ;; | |
| esac | |
| exit $RETCODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment