Skip to content

Shank404/Apex3_RGBController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

SteelSeries Apex 3 RGB Controller for Linux

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.

⚡ Features

  • 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.

🛠️ Prerequisites

You need Python 3 and the hidapi library.

Arch Linux:

sudo pacman -S python-hidapi

Debian/Ubuntu/Others:

sudo apt install python3-hid
# OR via pip
pip install hidapi

📦 Installation

  1. 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
  1. 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 trigger

🚀 Usage

Run 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 FFFFFF

🔄 Boot Persistence (Systemd)

To 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.service

Paste 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.target

Enable the service:

    sudo systemctl daemon-reload
    sudo systemctl enable apex3-rgb.service
    sudo systemctl start apex3-rgb.service

🔬 Technical Documentation

For 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).

⚠️ Disclaimer

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.

About

A lightweight, reverse-engineered Python CLI to control SteelSeries Apex 3 RGB lighting on Linux. Includes systemd integration for boot persistence and non-root access via udev rules.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages