I use Corsair RGB keyboard/mice and Phillips surrounding lighting, so I doubt this will work with any of those...
Can you 'please' make a way to call a secondary custom program that is fed data via stdin of what colors should be set at any given location with a documented interface? This will make it utterly trivial on linux to let Factorio plug in to any system, especially as controlling the colors of the Corsair stuff on Linux is as simple as just sending simple text formatted data commands to the appropriate device calls, and controlling the Phillips surround lighting is as simple as just sending formatted data to the appropriate local TCP pipe, setting up all this in Factorio is overkill, and focusing just on Razer stuff (which had absolutely no official linux support last I saw so I doubt your code will work here) is kind of blegh, however just sending the appropriate color commands to a secondary program that the user can specify would allow anyone to hook into anything they want (and even over time perhaps more features could be added such as controlling the phillips fans, vibration bars, etc...).
If such an interface were made I'd happily make the Corsair and Phillips programs (if anyone even still uses this phillips ambx stuff, though I know many use Corsair things) and put it up on github for any linux users to use it with. I even have a Razer Naga with color controls here and I could figure out how to plug into it as well or accept PR's for it.
Not the best pictures, but all lights out beside computer, with monitor off. Keyboard is doing blue raindrops effect currently (I should take a video, but eh...), computer in lower-right is red in front blue in back (hence blue tint on wall on right side of images), but here is the Phillips system in Red/Green/Blue color states (which my phone did not capture terribly well in darkness with a few bright light sources, it is not quite this overwhelming in person, but I don't usually turn it up this bright anyway):
It would be *awesome* to write a program to listen to stdin for events happening in the game and be able to do things like appropriate lighting effects on the phillips lights and keyboard with ripples and waves and all such. In addition to writing the code and putting up on github I'll take a movie of it in action as well. In addition I could turn on the fans based on, say, life level, and the vibration bar when under attack (in addition to lighting effects and ripples and such). That would be quite nicely immersive and a good example of what a generic 'game event' interface could do instead of just a single-manufacturer's lights. ^.^
(Plus I really *really* hate proprietary, single-platform interfaces, and Razer's community-built linux drivers are a bit more... troublesome than anyone else's, because Razer does a lot of stupid stuff in their USB protocols...)