Skip to content

Instantly share code, notes, and snippets.

@rafacouto
Created March 6, 2023 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafacouto/618cc913193bc961345a6f84b7cdbf07 to your computer and use it in GitHub Desktop.
Save rafacouto/618cc913193bc961345a6f84b7cdbf07 to your computer and use it in GitHub Desktop.
Script to reload the psmouse driver on x240 laptop
#!/bin/sh
# put this file on /lib/systemd/system-sleep/x240-mouse-driver
# to reload the psmouse driver on sleep events
# further info: `man systemd-sleep`
#PATH=/sbin:/usr/sbin:/bin:/usr/bin
case "$1" in
pre)
#code execution BEFORE sleeping/hibernating/suspending
/usr/sbin/modprobe -r psmouse
;;
post)
#code execution AFTER resuming
/usr/sbin/modprobe psmouse
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment