Skip to content

Fix TUF keyboard RGB, battery charge limits, and performance mode persistence#9

Merged
utajum merged 2 commits intomasterfrom
fix/tuf-rgb-battery-perfmode
Feb 22, 2026
Merged

Fix TUF keyboard RGB, battery charge limits, and performance mode persistence#9
utajum merged 2 commits intomasterfrom
fix/tuf-rgb-battery-perfmode

Conversation

@utajum
Copy link
Owner

@utajum utajum commented Feb 22, 2026

Summary

  • Add TUF keyboard RGB control via kbd_rgb_mode/kbd_rgb_state sysfs attributes — the primary RGB interface for TUF Gaming keyboards, derived from kernel source and asusctl analysis
  • Add systemd-tmpfiles config to fix sysfs permissions lost on reboot when kernel modules are built-in (affects battery charge limit + platform_profile)
  • Add readback verification after setting performance mode to detect and recover from kernel coupling between throttle_thermal_policy and platform_profile
  • Update udev rules and install script for new sysfs paths

Models affected

  • ASUS TUF Gaming A16 FA617NT (and all TUF models with kbd_rgb_mode)
  • ASUS ROG Zephyrus G14 GA403UM (performance mode persistence)
  • Any ASUS laptop on Fedora 43+ / kernel 6.12+ with built-in asus-wmi

Root cause analysis

Backlight / Aura controls do nothing (TUF)

Windows G-Helper calls DEVS(0x00100056, [0xb4, mode, R, G, B, speed]) directly via ATKACPI driver. Linux kernel exposes the same ACPI call through /sys/class/leds/asus::kbd_backlight/kbd_rgb_mode — but g-helper-linux was only writing to multi_intensity which many TUF models don't have. Now routes TUF models through kbd_rgb_mode with proper protocol (matching asusctl's implementation). Falls back to multi_intensity if kbd_rgb_mode doesn't exist — no risk to other models.

Battery limit ignored after reboot

Windows uses Task Scheduler to re-apply the limit at boot via direct ATKACPI. Linux kernel resets charge limit to 100% on every boot (asus_wmi_battery_add sets RSOC=100), and the sysfs file is created root-only (0644). If asus-wmi is built-in (common on Fedora), udev rules never fire. The new systemd-tmpfiles config ensures the file is writable before G-Helper starts.

Performance mode reverts to Standard after reboot (GA403UM)

Windows calls DEVS(0x00120075, mode) directly — no intermediate layer. Linux has both throttle_thermal_policy and platform_profile which can be coupled in the kernel — writing one may reset the other. Added readback verification with automatic re-apply if the thermal policy was overridden.

Files changed

File Change
src/Platform/Linux/LinuxAsusWmi.cs +3 methods: SetKeyboardRgbMode(), SetKeyboardRgbState(), HasKeyboardRgbMode()
src/USB/Aura.cs Route TUF ApplyAura()/ApplyDirect()/ApplyPower() through kbd_rgb_mode/state
src/Mode/ModeControl.cs Readback verification after setting thermal policy + platform profile
install/90-ghelper.conf NEW — systemd-tmpfiles for boot-time sysfs permissions
install/90-ghelper.rules Add kbd_rgb_mode/kbd_rgb_state udev chmod rules
install/install.sh Deploy tmpfiles config + chmod new sysfs paths
TODO.md Remove completed tmpfiles task

…sistence

- Add kbd_rgb_mode/kbd_rgb_state sysfs support for TUF Gaming keyboards
- Add systemd-tmpfiles config (90-ghelper.conf) for boot-time sysfs permissions
- Add performance mode readback verification for kernel coupling detection
- Update udev rules and install.sh for new TUF sysfs paths
@github-actions
Copy link

github-actions bot commented Feb 22, 2026

Build Artifacts

Built from commit c6db4d0Download from Actions run

Artifact Description
ghelper Native AOT binary
native-libs libSkiaSharp.so + libHarfBuzzSharp.so
appimage GHelper-x86_64.AppImage (all-in-one)

Quick test:

# Option 1: AppImage (easiest)
chmod +x GHelper-x86_64.AppImage
./GHelper-x86_64.AppImage

# Option 2: Native binary
chmod +x ghelper
./ghelper

Artifacts expire in 7 days.

Sync local installer with remote installer: add systemd-tmpfiles
deployment and TUF keyboard sysfs paths that were missing.
@utajum utajum merged commit 7678779 into master Feb 22, 2026
3 checks passed
@utajum utajum deleted the fix/tuf-rgb-battery-perfmode branch February 22, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant