This project is a Zig-based daemon for controlling ASUS Aura RGB lighting. It dynamically adjusts the LED colors based on the system's CPU temperature, utilizing the hidapi library to communicate with the ASUS Aura Mainboard's USB HID interface.
Forks into a daemon process to run continuously in the background. Monitors CPU temperature using system thermal zone data. Adjusts LED colors based on temperature: Blue for temperatures below the threshold. Red for temperatures above the threshold. Communicates with ASUS Aura devices via hidapi.
- ASUS Aura-compatible mainboard with USB HID interface.
- Operating System: Linux
- Zig (latest stable version)
- libhidapi (HID API library for USB communication)
- C standard library (libc)
- LLVM (for Zig compilation)
Install Zig: Follow the official Zig installation guide.
Clone the repository:
git clone [email protected]:keix/led-daemon.git
cd led-daemon
Build the project using Zig:
zig build
The compiled executable will be located at zig-out/bin/led-daemon.
Run the daemon:
./zig-out/bin/led-daemon
Stop the daemon:
kill -9 $(cat /tmp/led-daemon.pid) && rm /tmp/led-daemon.pid
The daemon will:
- Fork into the background.
- Continuously monitor the CPU temperature.
- Update the LED colors accordingly.
- main.zig: Entry point of the daemon, containing the logic for forking processes and managing the daemon lifecycle.
- Temperature Monitoring:
- Reads CPU temperature from /sys/class/thermal/thermal_zone0/temp.
- Parses and converts the temperature to Celsius.
- RGB Control:
- Sends USB HID commands to the ASUS Aura device to update LED colors based on the CPU temperature.
- Supports static color mode.
- Temperature Threshold: Adjust the TEMP_THRESHOLD constant in main.zig to set the temperature threshold for changing LED colors.
- Default Colors: Modify the getTemperatureColor function to customize the RGB values for different temperature ranges.