A collection of Linux drivers for the Razer devices, providing kernel drivers, DBus services and python bindings to interact with the DBus interface.
Website: Here
Before raising an issue saying something doesn't work, read this Wiki page, try not to create new issues if one exists, reopen it.
Here is a page documenting the installation and uninstallation procedures.
The following applications compliment and interact with this driver:
Have a look at the scripts directory. In the driver sub directory you will find the scripts to start the builtin keyboard effects.
Changing effect example
:: the following command will create a render node for the effect with the unique id: 8 [fx_uid,name,description] ::
razer_bcd_controller -C 8 "bars example" "new rendering node"
[Returns the render node uid of the created node]
:: to activate the render node with the unique id:2 execute the next command [rn_uid] (hint: the id was returned by the previous command) ::
razer_bcd_controller -b 2
[You should now see 3 moving color bars (Red,Blue,Green)]
:: Getting the available parameters of an effect with the unique id: 2 [rn_uid] ::
razer_bcd_controller -F 2
[Returns a json formatted list of the available effect parameters]
in this case:
{
"parameters_num" : 3 ,
"parameters_list": [
{
"key": "Effect Counter Array",
"id" : 1 ,
"type" : 11 ,
"description": "Counter values(int array)" },
{
"key": "Effect Direction Array",
"id" : 2 ,
"type" : 11 ,
"description": "Direction values(int array)" },
{
"key": "Effect Colors Array",
"id" : 3 ,
"type" : 14 ,
"description": "Base colors(rgb array)" },
]}
:: Setting a parameter for an effect with the unique id: 2 [rn_uid,parameter_index, array_index (use -1 if not an array), parameter_type,value(s) (enquote multiple values and use whitespaces to seperate)] ::
razer_bcd_controller -S 2 2 0 rgb "255 255 0"
[One bar should now have a yellow color]
:: Return to default effect ::
razer_bcd_controller -b 1
[You should now see the heatmap like default effect again]
And take a look at the daemon and tests sub directories in scripts. The daemon uses dbus as its IPC mechanism, so you are not bound to shell scripts (someone may even write a Gui to control the daemon , maybe like the node editor in blender)
In the file /usr/share/razer_bcd/bash_keyboard_functions.sh
there are some functions used before and after the daemon is started/stopped. These functions bind and unbind the chroma to the kernel
driver. You can source the file and then run bind_all
, this will attempt to bind chromas and skip any already binded. There is also a function called unbind_all
which as you would
of guessed unbinds all chroma keyboards.
[... To be written ...]
for a sneak peak take a look at:
(bash interface using daemon_controller)
scripts/tests/test_glimmer.sh
or simply call daemon_controller/razer_bcd_controller -h for a command overview.
(c api)
How to create a standalone effect easily using the included library ?
First of all we need an idea what the effect shall do.
In this example i just setup the keyboard for a dota profile
First we need to setup the library:
struct razer_chroma *chroma = razer_open();
To create an custom keyboard led layout we need to tell the library to activate the custom mode:
razer_set_custom_mode(chroma);
If the keyboard was using the custom mode before the keys are still lit with the last color settings ,so let us clear it:
razer_clear_all(chroma->keys);
To actually update the keyboard leds we need to razer_update (using the integrated keyboard led frame/keys struct):
razer_update_keys(chroma,chroma->keys);
So now that we got a black keyboard we want to light some keys in different colors
struct razer_rgb red = {.r=255,.g=0,.b=0}; //define a red color
struct razer_rgb yellow = {.r=255,.g=255,.b=0}; //define a yellow color
struct razer_rgb green = {.r=0,.g=255,.b=0}; //define a green color
struct razer_rgb blue = {.r=0,.g=0,.b=255}; //define a blue color
struct razer_rgb light_blue = {.r=0,.g=255,.b=255}; //define a light blue color
struct razer_pos pos;
char *abilities = "QWERDF";
for(int i = 0;i<strlen(abilities);i++)
{
razer_convert_ascii_to_pos(abilities[i],&pos);
razer_set_key_pos(chroma->keys,&pos,&red);
}
char *groups = "1234567";
for(int i = 0;i<strlen(groups);i++)
{
razer_convert_ascii_to_pos(groups[i],&pos);
razer_set_key_pos(chroma->keys,&pos,&yellow);
}
char *items = "YXCV";
for(int i = 0;i<strlen(items);i++)
{
razer_convert_ascii_to_pos(items[i],&pos);
razer_set_key_pos(chroma->keys,&pos,&light_blue);
}
razer_convert_ascii_to_pos('B',&pos);
razer_set_key_pos(chroma->keys,&pos,&green);
razer_convert_ascii_to_pos('A',&pos);
razer_set_key_pos(chroma->keys,&pos,&blue);
razer_convert_ascii_to_pos('S',&pos);
razer_set_key_pos(chroma->keys,&pos,&green);
Dont forget to update the keyboard with the new led color values:
razer_update_keys(chroma,chroma->keys);
Freeing the library is just as easy:
razer_close(chroma);
To compile just type:
gcc -std=c99 dota_keys.c -lrazer_chroma -lm -o dota_keys
After executing it you should now have a dota profile lighting up your keyboard.(dont forget to sudo) This is just a simple example using a ascii helper,if your profile needs to color function keys ,etc you can set the key colors by manually setting the pos.
How to create an effect to be used in the daemon ? Why not shoot for something crazy like a light blast originating from keys being pressed this time? Its not that much different than writing a self-hosted effect.
[... To be written ...]
Any effect or tool you might want to contribute is welcome. Please use your own source files to host your effects for merging. FX setup scripts, bug fixes, feature requests, etc are also welcome.
examples/dynamic
with daemon for passwordless GUI interface ?Thank you for all donations i really appreciate it!
Luis Fernandes 3.5
You can send your donations via PayPal to : feckelburger [at] gmx.net
The project is licensed under the GPL and is not affiliated with Razer, Inc.