Skip to content

Instantly share code, notes, and snippets.

@llybin
Last active April 23, 2025 02:42
Show Gist options
  • Save llybin/4740e423d8281d839ef013b6cc93db7f to your computer and use it in GitHub Desktop.
Save llybin/4740e423d8281d839ef013b6cc93db7f to your computer and use it in GitHub Desktop.
Asus TUF keyboard backlight
# Brightness
0 - Off
1 - Low
2 - Medium
3 - High
echo 1 > /sys/class/leds/asus::kbd_backlight/brightness
# State, when backlight is enabled
cat /sys/class/leds/asus::kbd_backlight/kbd_rgb_state_index
'cmd boot awake sleep keyboard'
cmd and keyboard - any digits, nothing changes for me
echo '1 1 1 0 1' > /sys/class/leds/asus::kbd_backlight/kbd_rgb_state
# Mode
cat /sys/class/leds/asus::kbd_backlight/kbd_rgb_mode_index
'cmd mode red green blue speed'
cmd - any digit, nothing changes for me
mode:
0 - Static
1 - Breathing
2 - Color Cycle
3 - Strobing
May vary on your laptop. Mine doesn't have a Strobing mode.
red,green,blue - 0-255
kcolorchooser --print | sed 's/#//' | awk '{printf "%d %d %d\n", strtonum("0x" substr($1,1,2)), strtonum("0x" substr($1,3,2)), strtonum("0x" substr($1,5,2))}'
speed:
0 - Slow
1 - Medium
2 - Fast
echo '1 2 255 255 255 0' > /sys/class/leds/asus::kbd_backlight/kbd_rgb_mode
You not able to read a current values, only to set it.
@llybin
Copy link
Author

llybin commented Feb 16, 2024

@llybin
Copy link
Author

llybin commented Jan 27, 2025

"CMD is actually the save command. Whenever you pass a 0, your changes are set but will not persist (not saved to firmware). Passing 1 to CMD saves the changes to the firmware. They will persist on reboot."

"Additionally, valid animation modes are actually from 0 to 11. Where modes 9 and 10 are equal."

Thank you, @meganukebmp llybin/AsusTUFLinuxKeyboard#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment