Difference between revisions of "HowTo Adjust The Display Brightness On A Laptop In Console Mode Using The Command Line"

From NST Wiki
Jump to navigationJump to search
(Adjust The Display Brightness Using the Command Line)
(Adjust The Display Brightness Using the Command Line)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
__TOC__
 
__TOC__
 
= Overview =
 
= Overview =
This page demonstrates how one can adjust the display 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 operation.
+
This page demonstrates how one can adjust the display 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.
  
<div class="centerBlock"><div class="noteMessage">'''Note:''' When 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.</div></div>
+
<div class="centerBlock"><div class="noteMessage">'''Note:''' When 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 commands shown of this page.</div></div>
  
 
= Adjust The Display Brightness Using the Command Line =
 
= Adjust The Display Brightness Using the Command Line =
This brightness display settings can be found in the '''[https://en.wikipedia.org/wiki/Sysfs sysfs]''' pseudo file system provided by the Linux kernel within the following directory:
+
This brightness display settings can be found and controlled in the '''[https://en.wikipedia.org/wiki/Sysfs sysfs]''' pseudo file system provided by the Linux kernel within the following directory:
  
 
  [root@nst34-mbp ~]# ls -al /sys/class/backlight/intel_backlight/
 
  [root@nst34-mbp ~]# ls -al /sys/class/backlight/intel_backlight/
Line 24: Line 24:
 
  [root@nst34-mbp ~]#
 
  [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.
+
The maximum brightness value for your laptop can be found here. The value shown below is for an '''Apple MacBook Pro model: A1502, EMC 2835'''. The ''root'' user or using ''sudo'' for a non-root user is ''required'' to make adjustments.
  
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/max_brightness
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/max_brightness
Line 30: Line 30:
 
  [root@nst34-mbp ~]#
 
  [root@nst34-mbp ~]#
  
Set the display brightness to 100% (I.e., Maximum Brightness).
+
Set the display brightness to 100% (I.e., Maximum brightness).
 
  [root@nst34-mbp ~]# echo 1388 > /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# echo 1388 > /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
Line 45: Line 45:
 
  [root@nst34-mbp ~]#
 
  [root@nst34-mbp ~]#
  
Set the display brightness to 7% (I.e., A dim console display setting).
+
Set the display brightness to 7% (I.e., A dim console display setting: 100/1388 ~ 7%).
 
  [root@nst34-mbp ~]# echo 100 > /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# echo 100 > /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
 
  [root@nst34-mbp ~]# cat /sys/class/backlight/intel_backlight/brightness
 
  100
 
  100
 
  [root@nst34-mbp ~]#
 
  [root@nst34-mbp ~]#

Latest revision as of 20:37, 21 September 2021

Overview

This page demonstrates how one can adjust the display 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.

Note: When 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 commands shown of this page.

Adjust The Display Brightness Using the Command Line

This brightness display settings can be found and controlled 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 for an Apple MacBook Pro model: A1502, EMC 2835. The root user or using sudo for a non-root user is required to make adjustments.

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

Note: It is best to do this setting remotely using an SSH session. If you turn the display off you will not be able to see the display (I.e., The text) on the console.
[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 ~]#

Set the display brightness to 7% (I.e., A dim console display setting: 100/1388 ~ 7%).

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