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

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

Overview

This page demonstrates how one can adjust the display brightness of 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 NST is running on battery operation.

Note: Running NST on an Apple MacBook Pro one can turn off the lighted Apple logo by setting the brightness value to the lowest possible setting using the command shown of this page.

Adjust The Display Brightness Using the Command Line

This brightness display setting can be found in the sysfs pseudo file system provided by the Linux kernel within the following directory:

[root@nst34-mbp ~]# ls -al /sys/class/backlight/intel_backlight/
 0
drwxr-xr-x 3 root root    0 Sep 20 10:42 .
drwxr-xr-x 6 root root    0 Sep 20 10:42 ..
-r--r--r-- 1 root root 4096 Sep 20 15:00 actual_brightness
-rw-r--r-- 1 root root 4096 Sep 20 15:00 bl_power
-rw-r--r-- 1 root root 4096 Sep 20 10:45 brightness
lrwxrwxrwx 1 root root    0 Sep 20 15:00 device -> ../../card0-eDP-1
-r--r--r-- 1 root root 4096 Sep 20 10:42 max_brightness
drwxr-xr-x 2 root root    0 Sep 20 15:00 power
-r--r--r-- 1 root root 4096 Sep 20 15:00 scale
lrwxrwxrwx 1 root root    0 Sep 20 10:42 subsystem -> ../../../../../../../class/backlight
-r--r--r-- 1 root root 4096 Sep 20 10:42 type
-rw-r--r-- 1 root root 4096 Sep 20 10:42 uevent
[root@nst34-mbp ~]#

The maximum brightness value for your laptop can be found here. The value shown below is from a Apple MacBook Pro model: A1502, EMC 2835.

[root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/max_brightness
1388
[root@nst34-mbp ~]#

Set the display brightness to 100% (I.e., Maximum Brightness).

[root@nst34-mbp ~]# echo 1388 > /sys/class/backlight/intel_backlight/brightness
[root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
1388
[root@nst34-mbp ~]#

Set the display brightness to 0% (I.e., Display off).

[root@nst34-mbp ~]# echo 0 > /sys/class/backlight/intel_backlight/brightness
[root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
0
[root@nst34-mbp ~]#