-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add experimental CoreDisplay API (fixes #26) #31
Conversation
This reverts commit bde9511.
Also, tweak copy
I was previously running macOS 10.14, and I skipped over Catalina to Big Sur. The current released version of Lumen seems to work fine for me on macOS 11. Is IOKit deprecated? Looking at Apple's IOKit Functions, Some notes / links to references, partially written down for myself, for later:
|
To clarify what I meant by "issues on Mac OS 10.12.4 and later with brightness reverting," the only issues that I'm aware of occur when running Lumen alongside f.lux. Without that, it works fine. As for any official documentation of the new However, some users may want to use Lumen along with other softwares that modify the display. In this PR, I added an option to use the private APIs, and made it default to But, If Lumen doesn't want to use the undocumented APIs, that's understandable. Here are some resources I've found from other brightness-related projects that have switched over to the private APIs or discussed it:
Searching GitHub for code that uses the private api methods reveals more as well. |
Would be a nice feature! |
This adds an option to use the undocumented private CoreDisplay and DisplayServices APIs to modify brightness, which should resolve issues on Mac OS 10.12.4 and later with brightness reverting.
Main changes:
experimental
to toggle the use of the new API. This defaults totrue
if OS version is >= 10.12.4.isUsingNewAPI
andtoggleExperimentalMode
to BrightnessController to manage this state.getBrightessNewAPI
,setBrightnessNewAPI
, andnotifySystemOfNewBrightness
to BrightnessController, using code adapted from fnesveda/ExternalDisplayBrightness.Also:
.gitignore
to avoid polluting repo.This works on my MacBookPro16,1 with AMD Radeon Pro 5300M running Mac OS 10.15.7. I'm able to run f.lux without the brightness changes of lumen being reverted after a few seconds (as in #26). @anishathalye I haven't written Objective-C before, and I'm open to any improvements! What do we think?