Set Screen Brightness in i3


Here's how to set screen brightness in Linux terminal.

Install CLI

You need a little tool:

sudo apt install brightnessctl

Current and Max Brightness

You can see what the current brightness level is and what the max possible level is by typing:

brightnessctl

And getting feedback like:

Device 'intel_backlight' of class 'backlight':
	Current brightness: 12200 (25%)
	Max brightness: 48000

Adjust Brightness

To set the brightness, choose some value between 0 and "Max brightness" and run the s or set command. For example:

~ ❯ sudo brightnessctl s 100
Updated device 'intel_backlight':
Device 'intel_backlight' of class 'backlight':
	Current brightness: 100 (0%)
	Max brightness: 48000

~ ➜ sudo brightnessctl s 48000
Updated device 'intel_backlight':
Device 'intel_backlight' of class 'backlight':
	Current brightness: 48000 (100%)
	Max brightness: 48000

~ ➜ sudo brightnessctl s 12000
Updated device 'intel_backlight':
Device 'intel_backlight' of class 'backlight':
	Current brightness: 12000 (25%)
	Max brightness: 48000

Adjust External Monitor Brightness

Well, what about external monitors? Turns out, brightnessctl doesn't handle those. You need a separate utility.

Install:

sudo apt install ddcutil

Find the monitors available:

sudo ddcutil detect

(If ever you get a "Display not found" error, re-run the detect command.)

Find out what you can adjust on your monitor:

sudo ddcutil capabilities

That will give you a looong list, including:

...
VCP Features:
   Feature: 02 (New control value)
   Feature: 04 (Restore factory defaults)
   Feature: 05 (Restore factory brightness/contrast defaults)
   Feature: 08 (Restore color defaults)
   Feature: 0B (Color temperature increment)
   Feature: 0C (Color temperature request)
   Feature: 10 (Brightness)
   Feature: 12 (Contrast)
...

Note that feature 10 is brightness. Now to adjust brightness, feature 10, using either relative or absolute values (0 to 100):

sudo ddcutil setvcp 10 - 25
sudo ddcutil setvcp 10 + 25
sudo ddcutil setvcp 10 0
sudo ddcutil setvcp 10 50
sudo ddcutil setvcp 10 100

Now, go easy on those eyes. Or, allow vision of the screen under that beautiful sun.