Fixing the ThinkPad TrackPoint after suspend
There's a well-known bug with the ThinkPad X1 Carbon Gen 5-7 and similar models from that era: the driver doesn't properly initialize the hardware after a suspend. You can usually fix it by putting the computer to sleep again and logging back in. However, that's a shitty way to deal with a problem a simple script can solve. Like, really simple.
The script
#!/bin/sh
# Reinitialize the ThinkPad TrackPoint after suspend/resume.
case "$1" in
post)
/usr/sbin/modprobe -r psmouse || true
/usr/bin/sleep 4
/usr/sbin/modprobe psmouse
/usr/bin/sleep 2
;;
esac
exit 0
That's all there is to it. It restarts the psmouse driver with a delay, and it's hooked into the systemd sleep-hook routine, so it runs after every resume.
Windows
When I used Windows a few years ago, I ended up doing the same thing with PowerShell and a scheduled task that runs on logon.