Last active
December 22, 2015 06:19
-
-
Save joshuabergeron/6430490 to your computer and use it in GitHub Desktop.
Sometimes my mouse is stuck after a resume on Ubuntu, this fixes it.
This file contains 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
/* replace the filename with appropriate usb device info for your computer. get device info from lsusb. */ | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/ioctl.h> | |
#include <linux/usbdevice_fs.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
const char *filename = "/dev/bus/usb/005/002"; | |
int fd; | |
seteuid(0); | |
fd = open(filename, O_WRONLY); | |
ioctl(fd, USBDEVFS_RESET, 0); | |
close(fd); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment