A Linux ACPI brightness control script

Brightness icon in featured image by Elegant Themes

When I started using i3 window manager, I knew I’d basically have to re-engineer a number of desktop environment features myself around the bare window manager. One of these features is easy brightness control on my laptop.

The Arch Wiki has a *great* and in-depth page on this as it can be a very complex matter with a bunch of different ways to manage it on different hardware. Here! But after that, and if the ACPI method works for you, here is the script I came up with to manage it on Ubuntu!

ACPI brightness controls

So if you see something listed like this then you probably have a backlight you can interact with

The files we’re interested in are brightness and max_brightness. Writing a value into brightness will… change the brightness! But one must be root to do this.

My script

So I made a script to do it! (Here is the current version of the script in my dotfiles, which may differ since the writing of this post)


If you’re going to bind this to some key combo, you may want to allow this to sudo without a password (as securely as possible).

Here is my binding for i3wm

So there you go!