Hello all, just dropping a note that a separate script is probably not necessary.
You could use something like this;
File:
/etc/systemd/system/restart-touchpad.service
Contents:
[Unit]
Description=Restart Touchpad
After=basic.target suspend.target hibernate.target
[Service]
user=root
Type=oneshot
ExecStart=/usr/bin/bash -c '\
/usr/bin/rmmod psmouse; \
/usr/bin/modprobe psmouse'
[Install]
WantedBy=basic.target suspend.target hibernate.target
Enable service:
systemctl enable restart-touchpad.service --now
But I will also note that psmouse
is maybe an odd module for a touchpad.
So, as written, it may or may not be applicable.
i2c_hid
is a likely candidate (or something related like i2c_hid_acpi
).
Did you identify the correct module already?