leds-corsair-m65 is a Linux kernel driver for controlling the LED zones color on the Corsair M65 Pro mouse.
The driver exposes the following sysfs led nodes:
- /sys/class/leds/corsair_m65::dpi
- /sys/class/leds/corsair_m65::logo
- /sys/class/leds/corsair_m65::wheel
You can control the LED via the brightness file. The valid values are binary from range 0 to 0xFFFFFF which translate to RGB colors, so for example red is 0xFF0000.
make
sudo insmod ./leds-corsair-m65.ko
I did at first but it wasn't that much fun, so I also did it in the kernel. ;-) Also I like the sysfs interface and the hidraw device number can change, so I prefer the kernel driver solution.
printf '\xff0000' | sudo tee /sys/class/leds/corsair_m65::logo
printf '\xff00ff' | sudo tee /sys/class/leds/corsair_m65::logo
rainbow.py is a simple Python script which utilizes the driver interface to animate the mouse leds through all hues.
demo.mov
- Find out the command (if there is any) to read the zone color to avoid hardcoding the default color
- Think how to make the nodes writable as a non-root user