Turn off keyboard backlight, Asus laptop (Ubuntu 15.10)

6,255

Create a bash-script:

sudo gedit /usr/sbin/asuskbbloff

with this content:

#!/bin/bash

KBBL="/sys/class/leds/asus::kbd_backlight"

# $KBBL may a directory or a symlink as of ubuntu 16.04
[ -d $KBBL -o -f $KBBL ] && echo 0 > $KBBL/brightness || echo "$KBBL does not exist!"

Make it executable:

sudo chmod 0755 /usr/sbin/asuskbbloff

Turn on your keyboard backlight and try to switch it off with this command:

sudo asuskbbloff

When it worked for you, create an upstart-file:

sudo gedit /etc/init/asuskbbloff.conf

with this content:

#
# This task is run on startup to turn of
# keyboard backlight on asus notebooks
# 

description     "turn of keyboard backlight"

start on startup

task
exec /usr/sbin/asuskbbloff

Reboot your system for testing.

Share:
6,255

Related videos on Youtube

Giorgi Khmaladze
Author by

Giorgi Khmaladze

Updated on September 18, 2022

Comments

  • Giorgi Khmaladze
    Giorgi Khmaladze over 1 year

    When I boot up my laptop (Asus K501UX) keyboard backlight is turned on automatically. I want to turn it off by default, when Ubuntu is loaded, without using any hot keys.

    sudo find /sys/class/leds/ output:

    /sys/class/leds/
    /sys/class/leds/asus::kbd_backlight
    /sys/class/leds/phy0-led
    /sys/class/leds/input3::scrolllock
    /sys/class/leds/input3::capslock
    /sys/class/leds/input3::numlock
    /sys/class/leds/asus::wlan
    
    • cmks
      cmks about 8 years
      Please open a shell and post the output of this command: sudo find /sys/class/leds/
    • Giorgi Khmaladze
      Giorgi Khmaladze about 8 years
      @cmks I have edited my question, please take a look, thank you for your response
  • cmks
    cmks about 8 years
    I edited the post, did you do it with sudo?
  • Giorgi Khmaladze
    Giorgi Khmaladze about 8 years
    sudo asuskbbloff says that: /sys/class/leds/asus::kbd_backlight does not exist!
  • cmks
    cmks about 8 years
    because it is a directory - I changed the test do -d- working now?
  • Giorgi Khmaladze
    Giorgi Khmaladze about 8 years
    now command asuskbbloff works but it doesn't run on startup
  • cmks
    cmks about 8 years
    does the command, when you start it, turn off the backlight?
  • Giorgi Khmaladze
    Giorgi Khmaladze about 8 years
    @cmks yep, but when i reboot shiny keyboard is back :d
  • Giorgi Khmaladze
    Giorgi Khmaladze about 8 years
    @Rinzwind it was not working on -f for me but now on -d it works
  • cmks
    cmks about 8 years
    try to but the command /usr/sbin/asuskbbloff in the file /etc/rc.local just before the line exit 0
  • Giorgi Khmaladze
    Giorgi Khmaladze about 8 years
    @cmks so now command asuskbbloff works and now, i guess, all i have to do is to run this command automatically at startup right?
  • cmks
    cmks about 8 years
    yes, the upstart file should do that job
  • Rinzwind
    Rinzwind about 8 years
    Recap: this works for me on 16.04 with the "-f" option, not the "-d". Files asked for in comment are listed as a "symlink". Using /etc/rc.local works during a boot.