Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to query the current brightness level of a the MacBook LCD?

The idea being that, once the brightness passes a certain level, one could switch to a different visual scheme to give greater visibility. Also, if it could be some sort of listener type thing, that would be even better, but I'll take what I can get.

like image 798
Paul Wicks Avatar asked Nov 05 '25 21:11

Paul Wicks


1 Answers

I believe one could look it up with IOKit. Running the ioreg command in the terminal as below gives two lines where a brightness value is visible.

% ioreg -c AppleGraphicsControlBacklight | grep brightness

| | |     "IODisplayParameters" = {"brightness"={"min"=0,"value"=408,"max"=1024},"commit"={"reg"=0}}
| |   |     "IODisplayParameters" = {"brightness"={"min"=0,"value"=408,"max"=1024},"commit"={"reg"=0}}

Maybe someone with enough IOKit knowledge could put together a sample...

like image 191
epatel Avatar answered Nov 08 '25 21:11

epatel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!