A lightweight, reverse-engineered Python driver to control the RGB lighting of the SteelSeries Apex 3 keyboard on Linux (specifically Arch Linux, though adaptable to others).
This project was born out of necessity, as the official SteelSeries GG software is not available for Linux. It communicates directly with the keyboard's HID interface using raw USB packets.
-
Simple CLI: Set colors using standard Hex codes (e.g., FF0000).
-
Boot Persistence: Systemd service integration to apply color settings automatically on startup.
-
Non-Root Access: Udev rules included to allow control without sudo.
-
Lightweight: Depends only on python-hidapi.
You need Python 3 and the hidapi library.
Arch Linux:
sudo pacman -S python-hidapiDebian/Ubuntu/Others:
sudo apt install python3-hid
# OR via pip
pip install hidapi- Install the Script
Copy the script to your system binary directory to use it as a global command.
# Assuming you are in the repo directory
sudo cp apex3-led.py /usr/local/bin/apex3-led
sudo chmod +x /usr/local/bin/apex3-led- Setup Permissions (Udev Rule)
To run the script without sudo, you must grant your user permission to write to the SteelSeries HID device.
Create the file /etc/udev/rules.d/99-steelseries.rules:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="161a", MODE="0666"
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="161a", MODE="0666"Reload the rules:
sudo udevadm control --reload-rules
sudo udevadm triggerRun the command followed by a 6-digit Hex color code.
# Set to Red
apex3-led FF0000
# Set to SteelSeries Orange
apex3-led FF5500
# Set to White
apex3-led FFFFFFTo ensure your color preference persists after a reboot, set up a one-shot systemd service.
Create the service file:
sudo nano /etc/systemd/system/apex3-rgb.servicePaste the configuration:
(Change FF0000 in the ExecStart line to your preferred default color)[Unit]
Description=SteelSeries Apex 3 RGB Initialization
After=multi-user.target usb_device.target
[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /usr/local/bin/apex3-led FF0000
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetEnable the service:
sudo systemctl daemon-reload
sudo systemctl enable apex3-rgb.service
sudo systemctl start apex3-rgb.serviceFor those interested in the reverse engineering process or porting this to other languages.
Device Targets:
Vendor ID: 0x1038
Product ID: 0x161a
Target Interface: 3 (Usage Page 0xFFC0)Protocol: The Apex 3 uses a 32-byte HID packet sent via SET_REPORT (Control Transfer) or write() to the Output Endpoint.
| Offset | Byte | Description | Value |
|---|---|---|---|
| 0x00 | Report ID | HID Report ID | 0x00 |
| 0x01 | Command | Set Color Opcode | 0x0B |
| 0x02 | Zone ID | Zone Identifier | 0x00 (All/Padding) |
| 0x03 | Red | Red Intensity | 0x00 - 0xFF |
| 0x04 | Green | Green Intensity | 0x00 - 0xFF |
| 0x05 | Blue | Blue Intensity | 0x00 - 0xFF |
| ... | ... | ... | Repeat R/G/B for 10 Zones |
Note: The keyboard has 10 lighting zones, requiring 30 bytes of color data (Bytes 2-31).
This software is not affiliated with SteelSeries. It is the result of reverse engineering USB captures. Use at your own risk. While unlikely, sending malformed HID packets has the theoretical potential to confuse device firmware.