Command-line display brightness control for macOS.
Command-line display brightness control for macOS.
Command-line display brightness control for macOS.
This tool enables you to set and obtain the brightness level of all internal and certain external displays from the command line or a script.
If you cannot control your display’s brightness from Displays System Preferences, you will not be able to do it with brightness. See this issue for more information and some potential other options.
brew install brightness
git clone https://github.com/nriley/brightness.git
cd brightness
make
sudo make installbrightness requires OS X/macOS 10.8 or later — but go back in the
commit history and you’ll find code compatible with older (Mac) OS X
versions.
Through macOS 10.12.3, brightness uses documented APIs. It works on
internal laptop displays. It doesn’t work on older Apple external
LCDs which connect via DVI and USB. I don’t know if it works on newer
external displays, such as Thunderbolt displays, because I don’t have
any to test with. (Feedback welcome.)
As of macOS 10.12.4 with the introduction of Night Shift, the
documented APIs fail to work correctly and Apple does not provide
replacement APIs. Therefore, brightness uses an undocumented
method to adjust
brightness.
macOS 11 on M1/Apple Silicon Macs require yet another undocumented method to adjust brightness (thanks to @jtbandes).
Set 100% brightness: brightness 1
Set 50% brightness: brightness 0.5
Show current brightness: brightness -l
…`
No open issues yet, or sync has not completed.