Alienware 13R3's backlight LED controller
alieneffects-13r3
is an lightweight and highly customizable application to control LED backlights (alien effects) of Alienware 13 R3 laptop in linux.
sudo pip3 install alienware-13r3-alien-effects
to installsudo python3 setup.py install
sudo alieneffects-13r3 --THEME_FILE <path-to-theme-file>
to apply a themeYou can write a config file .alieneffects-13r3.json
to specify themes directory
{
"THEMES_DIRECTORY": "/home/foo/bar/themes"
}
The log will be written to .alieneffects-13r3.log
{
"DESCRIPTION": "sets all zones to black color i.e. switches off all lights",
"ZONES": {
"POWER_BUTTON|ALIENWARE_LOGO|ALIEN_HEAD|LEFT_KEYBOARD|TOUCH_PAD|MIDDLE_LEFT_KEYBOARD|MIDDLE_RIGHT_KEYBOARD|RIGHT_KEYBOARD": [
{
"EFFECT": "SET_COLOR",
"COLOR": [0, 0, 0]
},
{
"EFFECT": "LOOP_SEQUENCE"
}
]
}
}
{
"DESCRIPTION": "set same random color for all zones",
"TEMPO": 300,
"DURATION": 11000,
"ZONES": {
"ALIENWARE_LOGO|ALIEN_HEAD|LEFT_KEYBOARD|TOUCH_PAD|MIDDLE_LEFT_KEYBOARD|MIDDLE_RIGHT_KEYBOARD|RIGHT_KEYBOARD": [
{
"EFFECT": "SET_COLOR"
},
{
"EFFECT": "LOOP_SEQUENCE"
}
]
}
}
Alienware 13 R3 has 8 configurable light zones as listed in the table below.
All lights can be controlled via USB protocol.
For this specific device vendor Id = 0x187c
and product Id = 0x0529
Commands can be passed using control transfers of USB protocol.
Note that this application can only be used for Alienware 13 R3 model, for other models refer to Alienfx by trackmastersteve
bmRequestType = 0x21
0... .... : Host to Device
.01. .... : Request Type = Class
...0 0001 : Recipient = Interface
bRequest = 9
wValue = 0x0202
wIndex = 0
bmRequestType = 0xa1
1... .... : Device to Host
.01. .... : Request Type = Class
...0 0001 : Recipient = Interface
bRequest = 9
wValue = 0x0202
wIndex = 0
Command | Packet Structure (bytes) | Desciption | Comment |
---|---|---|---|
Reset | 2 7 t 0 0 0 0 0 0 0 0 0 | t : type, t=3 : reset all off and stops the execution of sequences t=4 : reset all on | Should call before every change. This takes some time, and you should wait until the operation ends. Premature commands might fail. |
Get status | 2 6 0 0 0 0 0 0 0 0 0 0 | S : Sequence ID, Z : Zone | Can use this to wait until status is ready |
Morph | 2 1 S Z Z Z r g b R G B | S : Sequence ID, Z : Zone | Color changes from r g b to R G B . All bands use 8-bit color encoding. So each value must be between 0-255. |
Pulse | 2 2 S Z Z Z r g b 0 0 0 | S : Sequence ID, Z : Zone | |
Simple set | 2 3 S Z Z Z r g b 0 0 0 | S : Sequence ID, Z : Zone | |
Loop | 2 4 0 0 0 0 0 0 0 0 0 0 | S : Sequence ID, Z : Zone | Without this, LEDs will go off after walking through the user-specified color sequence. TODO: how does this know which sequence is the target? The last one mentioned? What happens if sequences are interleaved?) |
Execute | 2 5 0 0 0 0 0 0 0 0 0 0 | S : Sequence ID, Z : Zone | This must be called at the end. Start executing color sequences |
Save next command | 2 8 m 0 0 0 0 0 0 0 0 0 | m : mode, m=01: Initial State m=2: Plugged in - Sleep; Only the power-button works in this mode? m=5: Plugged in - Normal m=6: Plugged in - Charging m=7: On Battery - Sleep m=8: On Battery - Normal m=9: On Battery - Low | Save the next command to the specified mode. Must be followed by an Action or Loop |
Save all | 2 9 0 0 0 0 0 0 0 0 0 0 | Save slots permanently. If this command is not called, data slots will be lost on reboot | |
Tempo | 2 e t t 0 0 0 0 0 0 0 0 | t: tempo | AlienFX sets this value between 00:1e ~ 03:ae. |
Zone Alienware 13 R3 | Binary | Hex |
---|---|---|
Keyboard right | 000 0000 0000 0001 | 0x0001 |
Keyboard middle-right | 000 0000 0000 0010 | 0x0002 |
Keyboard middle-left | 000 0000 0000 0100 | 0x0004 |
Keyboard left | 000 0000 0000 1000 | 0x0008 |
unknown/unused | 000 0000 0001 0000 | 0x0010 |
Alien head | 000 0000 0010 0000 | 0x0020 |
Alienware logo | 000 0000 0100 0000 | 0x0040 |
Touch pad | 000 0000 1000 0000 | 0x0080 |
Power button | 000 0001 0000 0000 | 0x0100 |
The touch pad color changes and stays put.
If the loop command is not issued then the color goes away after a certain time.
Blink effect and Morph Effect need an extra tempo command, which determines the rate of blinking or morphing.
The blinking happens for sometime and stops.
Then morphing happens for sometime and stops.
This happens because both are set on same sequence.
The blink and morphing happens simulataneously.
But the blinking stops after some time.
This happens because loop command affects the latest sequence issued before it.
So we need to send two loop commands after every set of commands belonging to one sequence
The blink and morphing happens simulataneously and continously.
Multiple zones can be referenced at once for an effect as described in Zone codes section
Trackpad backlight
to Enable
in BIOS settingsAlienfx by trackmastersteve