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:
- 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.
- Close the lid to shut down the external screen. Dealing with a finicky power button on the external screen can be frustrating.
- Disconnect the laptop cable from the external screen and close the lid. This has been my go-to method for the past few months.
- 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.