Skip to content

Instantly share code, notes, and snippets.

@JackZielke
Last active February 20, 2022 05:40
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 JackZielke/42e4fe96ca33ae6b2e1c6d632d52f24f to your computer and use it in GitHub Desktop.
Save JackZielke/42e4fe96ca33ae6b2e1c6d632d52f24f to your computer and use it in GitHub Desktop.
Reset USB mouse when it stops working
#!/bin/bash
# must be run via sudo
cd /sys/bus/pci/drivers/ohci-pci
for i in ????:??:??.?;do echo -n "$i" >unbind;echo -n "$i" >bind;done
@JackZielke
Copy link
Author

This is probably due to a buggy motherboard, but every so often (months between occurrences) my USB mouse will stop working. I can alt-tab to a terminal or use a keyboard shortcut (Ctrl + Alt + T) to get a new terminal.

sudo fix-mouse.sh

And boom, the mouse works again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment