Skip to content

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.

License

Notifications You must be signed in to change notification settings

keix/led-daemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LED Daemon - ASUS Aura RGB Controller

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.

Features

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.

Requirements

Hardware

- ASUS Aura-compatible mainboard with USB HID interface.

Software

- Operating System: Linux

Dependencies:

- Zig (latest stable version)
- libhidapi (HID API library for USB communication)
- C standard library (libc)
- LLVM (for Zig compilation)

Installation

Prerequisites

Install Zig: Follow the official Zig installation guide.

Building the Project

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.

Usage

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.

Code Structure

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

Configuration

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

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages