HowTo Adjust The Keyboard Backlight Brightness On A Laptop In Console Mode Using The Command Line

From NST Wiki
Revision as of 20:36, 21 September 2021 by Rwh (talk | contribs) (Adjust The Keyboard Backlight Brightness Using the Command Line)
Jump to navigationJump to search

Overview

This page demonstrates how one can adjust the keyboard backlight brightness on a laptop computer running NST using the command line. It may be desirable to completely set the brightness value to the lowest possible setting to increase the time that an NST server is running on battery power.

Adjust The Keyboard Backlight Brightness Using the Command Line

This backlight brightness settings can be found and controlled in a sysfs pseudo file system provided by the Linux kernel. First the keyboard backlight directory needs to be discovered for the laptop manufacturer. Listing the following directory will help determine the location. The following output is from NST running on a Dell 7480 laptop.

[root@dell7480 ~]# ls -al /sys/class/leds/
total 0
drwxr-xr-x  2 root root 0 Sep 21 05:22 .
drwxr-xr-x 77 root root 0 Sep 21 05:22 ..
lrwxrwxrwx  1 root root 0 Sep 21 09:22 dell::kbd_backlight -> ../../devices/platform/dell-laptop/leds/dell::kbd_backlight
lrwxrwxrwx  1 root root 0 Sep 21 05:22 input4::capslock -> ../../devices/platform/i8042/serio0/input/input4/input4::capslock lrwxrwxrwx  1 root root 0 Sep 21 05:22 input4::numlock -> ../../devices/platform/i8042/serio0/input/input4/input4::numlock
lrwxrwxrwx  1 root root 0 Sep 21 05:22 input4::scrolllock -> ../../devices/platform/i8042/serio0/input/input4/input4::scrolllock
lrwxrwxrwx  1 root root 0 Sep 21 20:24 phy0-led -> ../../devices/pci0000:00/0000:00:1c.2/0000:02:00.0/leds/phy0-led
lrwxrwxrwx  1 root root 0 Sep 21 20:24 platform::micmute -> ../../devices/platform/dell-laptop/leds/platform::micmute
[root@dell7480 ~]# 

From above, directory "/sys/class/leds/dell::kbd_backlight" contains the keyboard backlight brightness settings.

[root@dell7480 ~]# ls -al /sys/class/leds/dell::kbd_backlight/
total 0
drwxr-xr-x 3 root root    0 Sep 21 09:22 .
drwxr-xr-x 4 root root    0 Sep 21 09:22 ..
-rw-r--r-- 1 root root 4096 Sep 21 09:22 brightness
-r--r--r-- 1 root root 4096 Sep 21 09:22 brightness_hw_changed
lrwxrwxrwx 1 root root    0 Sep 21 20:35 device -> ../../../dell-laptop
-r--r--r-- 1 root root 4096 Sep 21 09:22 max_brightness
drwxr-xr-x 2 root root    0 Sep 21 20:35 power
-rw-r--r-- 1 root root 4096 Sep 21 20:35 start_triggers
-rw-r--r-- 1 root root 4096 Sep 21 20:35 stop_timeout
lrwxrwxrwx 1 root root    0 Sep 21 09:22 subsystem -> ../../../../../class/leds
-rw-r--r-- 1 root root    0 Sep 21 20:35 trigger
-rw-r--r-- 1 root root 4096 Sep 21 09:22 uevent
[root@dell7480 ~]#

The following output is from NST running on a Dell 7480 laptop.