Brightness Fix on MacOS

TLDR

brightness CLI tool can adjust brightness for MacOS. I fix the code for Apple Silicon Chips.

Why brightness?

Well I will answer this question in a Q&A mode.

Why don’t use keyboard brightness down button?

Well, just for convenient. I have to press brightness down button for 16 times before I go to sleep.

Why not lower the lid of the laptop computer?

I use an external screen. This can only shutdown the laptop screen.

Why not shutdown the external screen power?

Bro, here are a few options to consider:

  1. Shut down your laptop for the day and restart it tomorrow. Sometimes it can take a while for MacOS to shut down and start up again.
  2. Close the lid to shut down the external screen. Dealing with a finicky power button on the external screen can be frustrating.
  3. Disconnect the laptop cable from the external screen and close the lid. This has been my go-to method for the past few months.
  4. Try running a simple one-line script.

After weighing the options, the fourth choice seems like the best way to go.

In short

Chivier/brightness: Command-line display brightness control for macOS.

Here I build a new one. Just remove some deprecated API for Apple Silicon can make this application work well again.

BTW, some monitor brightness cannot be read by system API, like my LG monitor. But you can still set brightness with system API. Sounds ridiculars, but this actually works very well now.

Other take-aways

Well, during this debugging work. I also tried LLDB for the first time. I use GDB for developing almost all the time. But LLDB look also very nice.

This command map helps me a log!

GDB to LLDB command map - 🐛 LLDB

And also GUI mode in LLDB:

https://stackoverflow.com/questions/19820247/is-there-a-tui-mode-for-standalone-lldb

just use gui to enter gui mode in lldb.


Brightness Fix on MacOS
http://blog.chivier.site/2024-03-14/a59d7f19bb41/
Author
Chivier Humber
Posted on
March 14, 2024
Licensed under