razer-cli icon indicating copy to clipboard operation
razer-cli copied to clipboard

Wave effect speed controll missing

Open AblakfosoMolyadek opened this issue 2 years ago • 4 comments

I wanted to mess around with the speed of the wave effect. (I wanted to slow it down a bit so it's not that 'flashy'). But it's not an option, as it is on the windows version of synapse. Then I wanted to edit the files responsible for the effects, but I couldn't find it out how to do it (& where to find it) (it's a skill issue of my side I guess). Can you add the feature of changing the speed of the wave effect to the app, or give advice how I could do it on my own?

AblakfosoMolyadek avatar Jul 19 '23 13:07 AblakfosoMolyadek

Edit: upon further inspection, there are no specific methods for changing speed in the open-source driver. This might be a driver limitation. Looking into it.

You can start by checking how this project sets other device properties: https://github.com/LoLei/razer-cli/tree/master/razer_cli/razer_cli/setter. I see extensive use of getattr which was confusing for me at first since I don't use Python a lot, but now I see it is just a way to programmatically specify which method you want to call. For some device functions, this isn't necessary but for lighting effects, it is because the open-source driver has different names for different lighting regions per device and for different effects and makes these part of the function names. For example, to change the light effect on my mouse, the methods are set_logo_breath(), set_logo_spectrum(), set_logo_static(), etc.

You can find these method names for your device in the open-source driver here (I'm guessing it's a keyboard so check keyboards.py): https://github.com/openrazer/openrazer/blob/master/daemon/openrazer_daemon/hardware/

Then you can work your way up from there figuring out how to add a command line arg to razer-cli and appropriately modify the call through up to the appropriate setter class.

sudosteve avatar Jul 22 '23 06:07 sudosteve

Looks like it is currently a limitation in the driver: https://github.com/openrazer/openrazer/blob/master/daemon/openrazer_daemon/dbus_services/dbus_methods/chroma_keyboard.py#L222

Looks like this would be your starting point: https://github.com/openrazer/openrazer/blob/29bbf766df429ca104a9919fdbd8bdccc1e4424d/driver/razerkbd_driver.c#L1547

https://github.com/openrazer/openrazer/blob/29bbf766df429ca104a9919fdbd8bdccc1e4424d/driver/razerchromacommon.c#L532

You'd want to modify the function definition in razerchromacommon.c/h to include a speed parameter and then modify razerkbd_driver.c/h to call it with a user specified value for only your keyboard, if you want to potentially upstream the fix. I can help you install the driver on Arch Linux. For that, this page is helpful: https://github.com/openrazer/openrazer/wiki/Building-a-package#build-packages-from-a-different-github-repository.

sudosteve avatar Jul 22 '23 07:07 sudosteve

Thanks for the help @sk8ersteve 🙏🏻

LoLei avatar Jul 25 '23 07:07 LoLei

Thanks @sk8ersteve, your help is really appreciated! I'm an absolute noob for coding (I just started learning it), so it's a bit too advanced for me at the moment. But I'll come back to it in a few weeks or (months), to see if I can solve it myself. (Will be a good exercise for me)

AblakfosoMolyadek avatar Jul 25 '23 10:07 AblakfosoMolyadek