20

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

Pilot6
  • 92,041

6 Answers6

32

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'
Jezor
  • 103
TellMeWhy
  • 17,964
  • 41
  • 100
  • 142
14

Try

xset led on

or

xset led 3

This worked well with my CMSTORM (Cooler Master Storm Devastator) keyboard.

5

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.

Pilot6
  • 92,041
4

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 :-)

2

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

Zanna
  • 72,312
Matt O.
  • 543
  • 2
  • 9
-1

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

dmgl
  • 263