Adjust the screen brightness from the command line

Find your laptop graphics card in /sys/devices

On my system, the internal, laptop screen is called eDP-1, so I search for card1-eDP-1:

$ find /sys/devices -name card1-eDP-1
/sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-eDP-1

If you get no hits, search for card1 instead and see what cards are present:

$ find /sys/devices -name card1
/sys/devices/pci0000:00/0000:00:02.0/drm/card1

When you've found it, cd into the dir and follow the steps below:

$ cd /sys/devices/pci0000:00/0000:00:02.0/drm/card1/card1-eDP-1

Find the max brightness

$ cat ./intel_backlight/max_brightness
1060

Find the current brightness

$ cat ./intel_backlight/brightness
1060

Adust the brightness

Here, I decrease the brightness, which was at 1060:

$ echo 900 | sudo tee ./intel_backlight/brightness
900

Set max brightness

$ cat ./intel_backlight/max_brightness | sudo tee ./intel_backlight/brightness
960

~ /home 🏠 ~ talks 💬 ~ bash ~ craftsmanship ~ db ~ dongxi ~ emacs ~ escenic ~ iam ~ java ~ js ~ language ~ latex ~ ldap ~ life ~ linux ~ llm ~ mac-os-x ~ mt-foo ~ network ~ norsk ~ python ~ quotes ~ running ~ security ~ travel ~ unix ~ various ~ vcs ~ webdesign ~ windows ~ discoveries ~ cv 🧙 ~

Licensed under CC BY Creative Commons License ~ 📡 RSS feed ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert