I am using ASUS UX303 LN, Laptop and Ubuntu Gnome 14.04 is installed on it. I cant find a way to turn on my keyboard backlight on it. The keyboard shortcut that works in windows is not working here. Please help
6 Answers
To enable the backlight:
echo 2 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
The 2
at echo 2 |
can be changed to a value between 0 - 3, with 3 being the brightest.
To disable the backlight, enter:
echo 0 | sudo tee /sys/class/leds/asus::kbd_backlight/brightness
The path may vary depending on laptop model and your OS. For example Lenovo Thinkpad L390 running Manjaro has /sys/class/leds/tpacpi::kbd_backlight/brightness
. You can use find
to see the correct path:
find /sys/class/leds -name '*kbd_backlight'
-
2It works when i type in, but when I add it as a custom keyboard shortcut its not working Jul 4, 2015 at 15:14
-
1
-
1
-
echo 0 | sudo tee /sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness echo 3 | sudo tee /sys/devices/platform/thinkpad_acpi/leds/tpacpi::kbd_backlight/brightness Thinkpad... Mar 14, 2021 at 12:50
Try
xset led on
or
xset led 3
This worked well with my CMSTORM (Cooler Master Storm Devastator) keyboard.
-
This worked for me. Plus, an easier way to apply this command at start up is to use Ubuntu's Startup Application and just and this command there. Worked perfectly Sep 18, 2022 at 13:05
You can turn on backlight by this command
sudo tee /sys/class/leds/asus::kbd_backlight/brightness <<< 3
This will set it to maximum. The number at the end means brightness ( 0 - 3).
You can link this command to some hot key combination.
You can also read article regarding setting up Ambient Light Sensor.
-
It works when i type in, but when I add it as a custom keyboard shortcut its not working Jul 4, 2015 at 15:17
-
2This is actually another topic how to setup a script requiring sudo to a key combination. It must be answered already somewhere. I make a script and set that it does not require a password in sudoers.– Pilot6Jul 4, 2015 at 15:21
-
-
This gives me
tee: '/sys/class/leds/asus::kbd_backlight/brightness': No such file or directory 3
. Anything else I can try?– AndycSep 14, 2020 at 17:52 -
Here's how I got it solved:
#!/bin/bash
# Adjust the keyboard backlight level
shopt -s -o nounset
declare -i KBD_BACKLIGHT_MAX=`cat /sys/class/leds/asus\:\:kbd_backlight/max_brightness`
declare -i KBD_BACKLIGHT_LEV=`cat /sys/class/leds/asus\:\:kbd_backlight/brightness`
# We need a parameter, etiher inc or dec
if [ $# -eq 0 ] ; then
exit 192
fi
case $1 in
-inc )
# increasing:
if [ ${KBD_BACKLIGHT_LEV} -lt ${KBD_BACKLIGHT_MAX} ] ; then
KBD_BACKLIGHT_LEV=${KBD_BACKLIGHT_LEV}+1
echo ${KBD_BACKLIGHT_LEV} | tee /sys/class/leds/asus::kbd_backlight/brightness
fi
;;
-dec )
# decreasing:
if [ ${KBD_BACKLIGHT_LEV} -gt 0 ] ; then
KBD_BACKLIGHT_LEV=${KBD_BACKLIGHT_LEV}-1
echo ${KBD_BACKLIGHT_LEV} | tee /sys/class/leds/asus::kbd_backlight/brightness
fi
;;
esac
exit 192
Save the above script in /opt/tweaks/kbd_backlight_adjust.
Then this needs to be run with sudo from a keyboard shortcut so we must add a line to sudoers.
Use visudo and add this line to the bottom:
your_username ALL=(root) NOPASSWD: /opt/tweaks/kbd_backlight_adjust
And finally create your keyboard shortcuts using these commands for increasing and decreasing the keyboard backlight:
sudo /opt/tweaks/kbd_backlight_adjust -inc
and
sudo /opt/tweaks/kbd_backlight_adjust -dec
That should do it :-)
I had the same issue with an Asus ROG laptop I'd purchased. Here's what I did to fix keyboard shortcuts in general.
sudo vim /etc/default/grub
You’ll find this line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
Simply add on to the end of it:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="
Save, Exit and Reboot
-
This is not working for me on an ASUS ROG G401IU with Ubuntu 20.04. I tried with both
acpi_osi=
,acpi_osi=linux
with and withoutacpi_backlight=vendor
. When I reboot the computer, the keyboard backlight is off again.– AndycSep 6, 2020 at 6:11
You can easily update kernel using "Ukku Kernel Update Utility" https://github.com/teejee2008/ukuu Updates to 5.x kernel solve all my problem on Asus UX433F (backlight, sound).