ccMSC / ckb

RGB Driver for Linux and OS X
http://forum.corsair.com/v3/showthread.php?t=133929
GNU General Public License v2.0
1.34k stars 169 forks source link

Change colors via script #503

Open evert opened 8 years ago

evert commented 8 years ago

Hey guys,

LOVE this project! It's really awesome and super grateful for the work you guys have put in. My question: I would like to integrate my build / alert system (continuous integration, monitoring tool) with my keyboard. So I can switch it to yellow or red when things are wrong.

In order for me to do this, I need to be able to control colors with a script. I'm reasonably proficient with make, bash, python, php and nodejs but not really C or C++.

Is this is a possibility today? If not, is there a place I could look at to make this happen?

Thanks again, Evert

webdev23 commented 7 years ago

Hi. I just made a php file that controls the ckb-daemon without the cue software: https://github.com/webdev23/phpCorsair

It generate a rainbow that you can stop anytime to keep the color palette. Dive in it you will be able to rely system files events to it. Following my tests, here is the shell commands you had to call to control the leds colors, and to dump save them in hardware. echo hwload > /dev/input/ckb1/cmd echo active > /dev/input/ckb1/cmd echo rgb ffff00 > /dev/input/ckb1/cmd echo hwsave > /dev/input/ckb1/cmd echo idle > /dev/input/ckb1/cmd

Any command sent on top of the cue software are still effective. You can send up to 60 commands by seconds, and it stay stable. If found php7 in shell/daemon mode very appropriate and stable to do this in high fps, there is like no cpu consumption. See the cue-daemon page on this repo. Thanks to the ckb author.