brightness
brightness copied to clipboard
Doesn't work on MacBook Pro M3
Doesn't work on MacBook Pro M3. I'm getting -536870201
error on every command.
I'm using macOS Sonoma 14.1.2.
→ brightness -l
display 0: main, active, awake, online, external, ID 0x2
brightness: failed to get brightness of display 0x2 (error -536870201)
display 1: active, awake, online, built-in, ID 0x1
brightness: failed to get brightness of display 0x1 (error -536870201)
→ brightness -d 0 1
brightness: failed to set brightness of display 0x2 (error -536870201)
→ brightness -d 1 1
brightness: failed to set brightness of display 0x1 (error -536870201)
P.S. The https://github.com/MonitorControl/MonitorControl project can change brightness, but it can't be used in CLI.
I found many tools that promised to query or set the brightness for my MacBook M2, no tool worked so far. But there is an App called "Lunar" with different controls for display brightness etc.
Using that tool can have benefits, but many options are Pro features. The tool is good, but I don't really need any of their UI features. I just wanted to use the CLI to query the current brightness of my internal Mac screen or turn it on / off. The CLI is not a Pro feature.
My background:
External displays are connected through a Zigbee outlet. The goal: Shut down all monitors other than the one showing a movie played by Plex. Through homebridge / Home Assistant / Alexa Echo, I could turn off all monitors. As long as the HDMI cable is connected, the Mac does not disconnect the screens. That is a good fit for me, cause all monitors use their own windows and these should stay where they are.
The internal screen is special and has to be controlled by a service running the CLI as follows:
# install CLI once (after installing the app)
/Applications/Lunar.app/Contents/MacOS/Lunar install-cli
# query internal screen
~/.local/bin/lunar displays "Built-in" --read brightness | grep brightness | awk -F':' '{ print $2 }'
# turn internal screen off
~/.local/bin/lunar displays "Built-in" brightness 0
# turn internal screen on
~/.local/bin/lunar displays "Built-in" brightness 100
Disclaimer: I'm not associated with the company providing this tool. I just found no other tool working on my device. Maybe someone can benefit from this. Otherwise, the tool here should just be fixed to work as expected. That would be equally acceptable for me.
I use Lunar too — it is fabulous and its developer provides excellent support. Definitely would recommend anyone for whom brightness is inadequate check it out.
@nriley , as this (brightness
) app developer would you please consider fixing this issue?
I don't have a MacBook Pro M3 (nor do I have any plans to replace my perfectly functional M1 any time soon) so I have no way to test. I don't know what the problem is. I have minimal to zero time to work on open source projects these days. So, I guess the answer is no? Lunar is great, just use it.
I don't have a MacBook Pro M3 (nor do I have any plans to replace my perfectly functional M1 any time soon) so I have no way to test. I don't know what the problem is. I have minimal to zero time to work on open source projects these days.
Someday maybe.
Lunar is great, just use it.
For now, I'm using MonitorControl, which is free and does just that: regulates brightness, but from UI only. It just can't do that from the command line or the AppleScript.
It has some code from https://github.com/waydabber/BetterDisplay project to support MacBook M3 (probably https://github.com/MonitorControl/MonitorControl/commit/c5c8bf1b3c22d3302ab395d8b6f588d59ad76ceb , but not sure), but I don't know Swift at all to make any use of it.
gives the same error on m1 Macs too, any fixes?
edit: works fine when built from source
Doesn't work on my MacBook Air M2 either. I get the same error. It worked find on my ten-year-old MacBook Pro but not a new MacBook Air.
I have the same -536870201 error on M1 Macbook Pro 16