openrazer / openrazer

Open source driver and user-space daemon to control Razer lighting and other features on GNU/Linux
https://openrazer.github.io
GNU General Public License v2.0
3.68k stars 533 forks source link

Feature request: "base" color under all effects #2267

Open trathborne opened 5 months ago

trathborne commented 5 months ago

Under OpenRGB, I was able to specify a "base" color when an effect is not active. For example my keyboard would normally be 50% red, and ripple to 100% red in response to typing.

With openrazer+polychromatic, I can only have black as the base color. I need a non-black base color so I can see the keyboard in the dark. I sent polychromatic feedback about this but then I looked into openrazer and can't find this feature.

I am looking at daemon/openrazer_daemon/misc/ripple_effect.py and it looks like self._colour defaults to black and is updated wherever the effect applies. So I guess somewhere up a level I would find where that default could be parameterized for all effects.

Send me some pointers and I'll make an MR!

lah7 commented 5 months ago

Technically, it's because the effects in OpenRazer (except from Ripple) are handled by the hardware. An advantage being the device can persist them across reboots and different OSes. Disadvantage is that they're limited to the firmware (mostly it's just the colour, speed and 2 directions) and we can't alter them. OpenRazer is mostly like this from historically starting in the Synapse 2-era. These days, Razer Synapse 3 handles it all in software!

Ripple is a software effect that openrazer-daemon handles, so that one can be tweaked easily. There are two pull requests that prototype some changes:

For all effects to be customisable (like Wave, Reactive), they all need to be rewritten in software. I think the architecture of OpenRazer is in need of an overhaul to support both kinds (and possibly need work on matching the keyboard layout on some devices), but it could certainly be accomplished as a script using the Python API. New examples are welcome:

I think a 'challenge' for stand-alone scripts is to figuring out how to watch for key presses and mapping key to an LED in the matrix (for interactive effects) - there is a KEY_MAPPING in openrazer_daemon.keyboard for the original BlackWidow Chroma (and similiar).

For ripple specifically, I guess it could be a new configuration key in razer.conf, like ripple_base_colour = FF0000?