{ "info": { "author": "Yashasvi Sriram", "author_email": "yash.3997@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 3" ], "description": "# Alien Effects for Alienware 13 R3\n\n[![GitHub license](https://img.shields.io/badge/license-GNU%20GPL%20V3-blue.svg)](https://github.com/Yashasvi-Sriram/alieneffects-13r3/blob/master/LICENSE)\n[![Python3](https://img.shields.io/badge/python-3.6-green.svg)]()\n[![PyPI](https://img.shields.io/badge/version-0.2.2-%23ff69b4.svg)](https://pypi.org/project/alienware-13r3-alien-effects/)\n\n`alieneffects-13r3` is an lightweight and highly customizable application to control LED backlights (alien effects) of Alienware 13 R3 laptop in linux.\n\n# Installation and usage\n\n* python version \n * 3.6 is recommended\n * 3.4 may not work\n * 2 is strongly discouraged\n* `sudo pip3 install alienware-13r3-alien-effects` to install\n* To install from source, clone this repo and `sudo python3 setup.py install`\n* `sudo alieneffects-13r3 --THEME_FILE ` to apply a theme\n* `sudo alieneffects-13r3` to open a Textual User Interface where you can select themes\n * First field is the themes directory\n * After setting it, a list of files in the that directory will appear below\n * By hovering through them, you can see the overview of each theme on the right panel\n * Press enter to apply a theme\n * Some themes have stochasticity (randomness) in them, so applying same theme multiple times can lead to different themes\n\n![Alt TUI](github/tui-screenshot.png)\n\n# Config file\n\n* Themes directory by default will be your home directory\n* You can write a config file `.alieneffects-13r3.json` to specify themes directory\n```\n {\n \"THEMES_DIRECTORY\": \"/home/foo/bar/themes\"\n }\n```\n# Writing your own themes\n\n* The log will be written to `.alieneffects-13r3.log`\n* Theme files are also json files and can contain following keys\n * DESCRIPTION - describes the theme\n * TEMPO - the frequency of blinking and/or morphing\n * DURATION - duration of each effect\n * ZONES - sequences of each zone\n * ex. POWER_BUTTON\n * ex.\n * SET_COLOR, COLOR\n * BLINK_COLOR, COLOR\n * MORPH_COLOR, COLOR1, COLOR2\n * LOOP_SEQUENCE\n* Same sequence can be applied for multiple zones by delimiting zones with '|'\n* If an effect does not have a color, a random color will be choosen\n* The simplest theme is to switch off all lights\n```\n {\n \"DESCRIPTION\": \"sets all zones to black color i.e. switches off all lights\",\n \"ZONES\": {\n \"POWER_BUTTON|ALIENWARE_LOGO|ALIEN_HEAD|LEFT_KEYBOARD|TOUCH_PAD|MIDDLE_LEFT_KEYBOARD|MIDDLE_RIGHT_KEYBOARD|RIGHT_KEYBOARD\": [\n {\n \"EFFECT\": \"SET_COLOR\",\n \"COLOR\": [\n 0,\n 0,\n 0\n ]\n },\n {\n \"EFFECT\": \"LOOP_SEQUENCE\"\n }\n ]\n }\n }\n```\n* The random theme sets random color to all zones\n```\n{\n \"DESCRIPTION\": \"set same random color for all zones\",\n \"TEMPO\": 300,\n \"DURATION\": 11000,\n \"ZONES\": {\n \"ALIENWARE_LOGO|ALIEN_HEAD|LEFT_KEYBOARD|TOUCH_PAD|MIDDLE_LEFT_KEYBOARD|MIDDLE_RIGHT_KEYBOARD|RIGHT_KEYBOARD\": [\n {\n \"EFFECT\": \"SET_COLOR\"\n },\n {\n \"EFFECT\": \"LOOP_SEQUENCE\"\n }\n ]\n }\n}\n```\n\n# Introduction - Reverse Engineering\n\n![Alt TUI](github/alienware-13r3.jpg)\n\nAlienware 13 R3 has 8 configurable light zones as listed in the table below.\n\nAll lights can be controlled via USB protocol.\n\nFor this specific device `vendor Id = 0x187c` and `product Id = 0x0529`\n\nCommands can be passed using control transfers of USB protocol.\n\nNote that this application can only be used for Alienware 13 R3 model, for other models refer to [Alienfx](https://github.com/trackmastersteve/alienfx) by trackmastersteve\n\n# Control transfer: Write operation parameters\n\n bmRequestType = 0x21\n 0... .... : Host to Device\n .01. .... : Request Type = Class\n ...0 0001 : Recipient = Interface\n bRequest = 9\n wValue = 0x0202\n wIndex = 0\n\n# Control transfer: Read operation parameters\n\n bmRequestType = 0xa1\n 1... .... : Device to Host\n .01. .... : Request Type = Class\n ...0 0001 : Recipient = Interface\n bRequest = 9\n wValue = 0x0202\n wIndex = 0\n\n# Commands\n\n| Command | Packet Structure (bytes) | Desciption | Comment | \n| -- | -- | -- | -- |\n| 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. \n| 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 | \n| 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. | \n| Pulse | 2 2 S Z Z Z r g b 0 0 0 | S : Sequence ID, Z : Zone | | \n| Simple set | 2 3 S Z Z Z r g b 0 0 0 | S : Sequence ID, Z : Zone | | \n| 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?) | \n| 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 | \n| 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 | \n| 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 |\n| Tempo | 2 e t t 0 0 0 0 0 0 0 0 | t: tempo | AlienFX sets this value between 00:1e ~ 03:ae. |\n\n# Zone codes\n\n* A 16 bit code space is to reference each light zone.\n* One hot encoding is used; i.e. address for each zone has 1 at a unique place and 0's elsewhere\n* Multiple zones can be addressed by ORing their codes\n * For example to address the entire keyboard use 0x1\\|0x2\\|0x4\\|0x8=0xF code\n* A lot more zone codes and command codes might exist, which can do things we dont know about (yet), \n * For example setting multiple zones to different colors and such stuff\n\n| Zone Alienware 13 R3 | Binary | Hex | \n| -- | -- | -- | \n| Keyboard right | 000 0000 0000 0001 | 0x0001 |\n| Keyboard middle-right | 000 0000 0000 0010 | 0x0002 |\n| Keyboard middle-left | 000 0000 0000 0100 | 0x0004 |\n| Keyboard left | 000 0000 0000 1000 | 0x0008 |\n| unknown/unused | 000 0000 0001 0000 | 0x0010 |\n| Alien head | 000 0000 0010 0000 | 0x0020 |\n| Alienware logo | 000 0000 0100 0000 | 0x0040 |\n| Touch pad | 000 0000 1000 0000 | 0x0080 |\n| Power button | 000 0001 0000 0000 | 0x0100 |\n\n# How it works?\n\n### Simple Set Color example\n* Send a reset command\n* Send a set color effect command (to say touch pad)\n* Send a loop command\n* Send an execute command\n\nThe touch pad color changes and stays put.\nIf the loop command is not issued then the color goes away after a certain time.\n\n### Blink or Morph example\n* Send a reset command\n* Send a tempo command\n* Send a blink effect command (to say touch pad)\n * Morph effect command needs 2 colors\n* Send a loop command\n* Send an execute command\n\nBlink effect and Morph Effect need an extra tempo command, which determines the rate of blinking or morphing.\n\n### Multiple effects at different zones\n* Send a reset command\n* Send a tempo command\n* Send a blink effect command (to say touch pad)\n* Send a morph effect command (to say logo)\n* Send a loop command\n* Send an execute command\n\nThe blinking happens for sometime and stops.\nThen morphing happens for sometime and stops.\nThis happens because both are set on same sequence.\n\n### Multiple effects at different zones simultaneously\n* Send a reset command\n* Send a tempo command\n* Send a blink effect command on sequence 1 (to say touch pad)\n* Send a morph effect command on sequence 2 (to say logo)\n* Send a loop command\n* Send an execute command\n\nThe blink and morphing happens simulataneously.\nBut the blinking stops after some time.\nThis happens because loop command affects the latest sequence issued before it.\nSo we need to send two loop commands after every set of commands belonging to one sequence\n\n### Multiple effects at different zones simultaneously and continuously\n* Send a reset command\n* Send a tempo command\n* Send a blink effect command on sequence 1 (to say touch pad)\n* Send a loop command\n* Send a morph effect command on sequence 2 (to say logo)\n* Send a loop command\n* Send an execute command\n\nThe blink and morphing happens simulataneously and continously.\nMultiple zones can be referenced at once for an effect as described in Zone codes section\n\n# Misc\n* Some zones (like power button) seems to be only be accessible in some states (like pugged in, on battery, on battery low) only\n* If same zone is addressed in different sequences flashing can happen\n* If you cannot control touch pad, set `Trackpad backlight` to `Enable` in BIOS settings\n\n# Disclaimer\n\n* All the information here is obtained via trail and error reverse engineering, because the alienware lights software doesn't seem to be opensource\n* There is no conclusive evidence that these methods are the best way to go\n* But they do work and did no harm to my system until now\n\n# References\n[Alienfx](https://github.com/trackmastersteve/alienfx) by trackmastersteve\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Yashasvi-Sriram/alieneffects-13r3", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "alienware-13r3-alien-effects", "package_url": "https://pypi.org/project/alienware-13r3-alien-effects/", "platform": "", "project_url": "https://pypi.org/project/alienware-13r3-alien-effects/", "project_urls": { "Homepage": "https://github.com/Yashasvi-Sriram/alieneffects-13r3" }, "release_url": "https://pypi.org/project/alienware-13r3-alien-effects/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "Backlight LED controller for alienware 13 R3", "version": "0.2.2" }, "last_serial": 4631162, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "05c3f234da8d344db46d724c299b0caf", "sha256": "8055a4929aebc6cd7e62a7e6c31d12059c934d8e1480e6b75dd2a208de059381" }, "downloads": -1, "filename": "alienware_13r3_alien_effects-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "05c3f234da8d344db46d724c299b0caf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25768, "upload_time": "2018-12-20T11:46:58", "url": "https://files.pythonhosted.org/packages/95/28/f0f71acee5971d1079003f1e6d1172d5ec88fa3b9ffa386ab467cf52a9a8/alienware_13r3_alien_effects-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba7fc112ec4c59897a183de7b424d1cd", "sha256": "19a488e01c686fdf7d13a045c12cf127a7ac95c72c091325330863a16cebd67a" }, "downloads": -1, "filename": "alienware-13r3-alien-effects-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ba7fc112ec4c59897a183de7b424d1cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11818, "upload_time": "2018-12-20T11:47:02", "url": "https://files.pythonhosted.org/packages/ed/43/0c48173a6a720edde2aac106f85b0f1fdab4afa9f4f6797c8232fd87f63c/alienware-13r3-alien-effects-0.1.2.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "f1fba6bbf7f039c7878be0768e15d4d9", "sha256": "8db06159843c40abb5d968f0a9d79851fda3a80162bab81aa408b9af23bdf779" }, "downloads": -1, "filename": "alienware_13r3_alien_effects-0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f1fba6bbf7f039c7878be0768e15d4d9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25760, "upload_time": "2018-12-20T12:04:27", "url": "https://files.pythonhosted.org/packages/d5/ef/9b01e819334075da4e5ca138ffe42ca076b35d9692e139bcc0083c61b60e/alienware_13r3_alien_effects-0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "7b5976ea201db98915a08a00861e451d", "sha256": "d7dbefb81cc5e78bd07e59ddbc7fb3401f8045287810544a5bcc8af8792ad352" }, "downloads": -1, "filename": "alienware-13r3-alien-effects-0.2.tar.gz", "has_sig": false, "md5_digest": "7b5976ea201db98915a08a00861e451d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11830, "upload_time": "2018-12-20T12:04:29", "url": "https://files.pythonhosted.org/packages/ed/5f/c9f695d7d6633a6e819de4761c94a71ac704bc4b65e3d85b1548fb6666bb/alienware-13r3-alien-effects-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4edb691ef7584c96e37286a7df3f234e", "sha256": "d6b9288f6ce2dea696cacc3648b11322f12734c2255e9a76b44ba801ac4c1ae2" }, "downloads": -1, "filename": "alienware_13r3_alien_effects-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "4edb691ef7584c96e37286a7df3f234e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 25785, "upload_time": "2018-12-20T12:07:14", "url": "https://files.pythonhosted.org/packages/f3/2f/2d6180bf0dc566c08e70a99702873918b0835a2288314bea6ff783cdcb27/alienware_13r3_alien_effects-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b391e93a49e944c6fee477e9a99b8940", "sha256": "c70a490cfddb3f2f76e17c2f4df77aba585020f05ce17e86151d62aae8bc7725" }, "downloads": -1, "filename": "alienware-13r3-alien-effects-0.2.1.tar.gz", "has_sig": false, "md5_digest": "b391e93a49e944c6fee477e9a99b8940", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11843, "upload_time": "2018-12-20T12:07:16", "url": "https://files.pythonhosted.org/packages/73/4c/fdcc7090a533fa42f5e0b3db5eac66016f57180c0502f45d29300dfdde69/alienware-13r3-alien-effects-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "55a0957a4a2d9beb236e5c27c5acdeeb", "sha256": "4f5dbf8759e7d8f80ca4bc765083e08bac7524cb54db6b6787fb477eb67b25a5" }, "downloads": -1, "filename": "alienware_13r3_alien_effects-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "55a0957a4a2d9beb236e5c27c5acdeeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26214, "upload_time": "2018-12-24T11:03:55", "url": "https://files.pythonhosted.org/packages/e9/f7/134fbc7d91cb3fb721ee822135a9a8d4733d44f1394d3d35fc712915eb54/alienware_13r3_alien_effects-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "38fe7babc9a5bc15d31757addbe50b99", "sha256": "61093a56079652a0419231d186b214db5a0316193073695e69d6ecd6df592af8" }, "downloads": -1, "filename": "alienware-13r3-alien-effects-0.2.2.tar.gz", "has_sig": false, "md5_digest": "38fe7babc9a5bc15d31757addbe50b99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12031, "upload_time": "2018-12-24T11:03:57", "url": "https://files.pythonhosted.org/packages/d9/18/b8642524a2f33135b3f0c570158f8463673cc85e1e4bad7d913c2e257aae/alienware-13r3-alien-effects-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55a0957a4a2d9beb236e5c27c5acdeeb", "sha256": "4f5dbf8759e7d8f80ca4bc765083e08bac7524cb54db6b6787fb477eb67b25a5" }, "downloads": -1, "filename": "alienware_13r3_alien_effects-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "55a0957a4a2d9beb236e5c27c5acdeeb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 26214, "upload_time": "2018-12-24T11:03:55", "url": "https://files.pythonhosted.org/packages/e9/f7/134fbc7d91cb3fb721ee822135a9a8d4733d44f1394d3d35fc712915eb54/alienware_13r3_alien_effects-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "38fe7babc9a5bc15d31757addbe50b99", "sha256": "61093a56079652a0419231d186b214db5a0316193073695e69d6ecd6df592af8" }, "downloads": -1, "filename": "alienware-13r3-alien-effects-0.2.2.tar.gz", "has_sig": false, "md5_digest": "38fe7babc9a5bc15d31757addbe50b99", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12031, "upload_time": "2018-12-24T11:03:57", "url": "https://files.pythonhosted.org/packages/d9/18/b8642524a2f33135b3f0c570158f8463673cc85e1e4bad7d913c2e257aae/alienware-13r3-alien-effects-0.2.2.tar.gz" } ] }