Reduce Debian/Ubuntu screen brightness using /sys/class

Last updated on January 30th, 2023 at 11:37 am.

Reduce Debian/Ubuntu screen brightness using /sys/class

About /sys/class

/sys/class is a virtual file system on Linux that exposes information about various kernel classes. It provides an interface to retrieve and edit information about different hardware components, drivers, and subsystems in the system. Each directory in /sys/class represents a different class of devices. And the files inside each directory provide information and control over the corresponding device. The data in /sys/class is dynamic and reflects the current state of the system.

Changing the screen brightness using /sys/class

To check current brightness level of your screen run:

cat /sys/class/backlight/intel_backlight/brightness

Change permissions of the sys/class file responsible for screen brightness to be editable:

sudo chmod o+w /sys/class/backlight/intel_backlight/brightness

Then decrease the brightness to any level you prefer for instance 300:

echo "300" > /sys/class/backlight/intel_backlight/brightness

For security, revert the permission of the file back to original after editing it:

sudo chmod 644 /sys/class/backlight/intel_backlight/brightness

More options for editing screen brightness can be found in the answer here.

Comment Here