Script written to modify the Luxafor USB LED indicator via command line using python.
Any and all improvements welcome and appreciated.
Credit to gist by dave-irvine for pyusb code.
- Luxafor LED Indicator
- Python 2.7+
- PyUSB
- Luxafor LED Indicator
- Luxafor Software
- Python 2.7+
- PyWinUSB (installable via pip)
- Windows 10
- Ubuntu 15.10
- Sometimes first run doesn't work, have to run command a second time
By default python will not let use usb libs and you will need to run command with sudo
everytime. To prevent this you will need to do the following:
1: Create a file, /lib/udev/rules.d/50-luxafor.rules
with the following contents:
# Allow Luxafor USB control
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f372", MODE="660", GROUP="plugdev"
2: Reload the udevadm
using the following commands:
sudo udevadm control --reload
sudo udevadm trigger
3: Unplug and reinsert your Luxafor device
- Seems the Luxafor app has to be at least running in the tray for commands to persist
- Opening the Luxafor app switches the color to Green/Red (depeding on last used?)
- Seems that it doesn't always return to the exact same state it was in before a strobe or pattern is ran
-l = LED - 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color
-r = RED value (0-255)
-g = GREEN value (0-255)
-b = BLUE value (0-255)
-s = Speed value - Determines speed of strobe or fade (0-255)
-t = Repeat value - Determines the frequency of strobe or wave (0-255)
-w = Wave value - 5 Different Patterns available (1-5)
-p = Built In Patterns - 8 built in patterns
-x = Hex color value - ("#RRGGBB")
Set the specified LED to the specified color
luxafor-linux.py color -l 255 -r 255 -g 0 -b 0
luxafor-linux.py color -x "#F22613"
luxafor-linux.py fade -l 255 -r 0 -g 255 -b 0
luxafor-linux.py strobe -l 255 -r 0 -g 0 -b 255 -s 20 -t 5
luxafor-linux.py wave -w 4 -r 0 -g 0 -b 255 -s 20 -t 3
luxafor-linux.py pattern -p 2 -r 3
Raw data array posisitions as follows:
- Always 0
- 1
- 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color
- RED Value 0-255
- GREEN Value 0-255
- BLUE Value 0-255
- N/A
- N/A
- N/A
Raw data array posisitions as follows:
- Always 0
- 2
- 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color
- RED Value 0-255
- GREEN Value 0-255
- BLUE Value 0-255
- Changing Time (Duration)
- N/A
- N/A
Raw data array posisitions as follows:
- Always 0
- 3
- 1-6 for specific LED, 65 for front, 66 for back, 0 for all, 255 for all one color
- RED Value 0-255
- GREEN Value 0-255
- BLUE Value 0-255
- Speed (30-40 is a fairly calm value)
- N/A
- N/A
- Always 0
- 4
- Wave Type
- RED Value 0-255
- GREEN Value 0-255
- BLUE Value 0-255
- N/A
- Repeat (0-255)
- Speed (10 is a fairly good value)
- Always 0
- 6
- Pattern Number (1-8)
- Repeat (0-255)
- N/A
- N/A
- N/A
- N/A
- N/A