Support M1 Macs using DisplayServicesGetBrightness/DisplayServicesSetBrightness#36
Support M1 Macs using DisplayServicesGetBrightness/DisplayServicesSetBrightness#36nriley merged 1 commit intonriley:masterfrom jtbandes:master
Conversation
…Brightness - Tested on a M1 MacBook Air running Big Sur, for the built-in display. - Extracted functions from the main loop to avoid it getting too complicated. - Also made minor changes to fix a warning about `brightness` being uninitialized.
|
Thanks! Testing help appreciated. |
…layServicesSetBrightness" nriley#36.
…tness/DisplayServicesSetBrightness".
|
Thanks @jtbandes, this change works form me on both my M1 & Intel MacBooks 😄 However one line of the PR breaks |
|
|
||
| float brightness; | ||
| if (action == ACTION_LIST) { | ||
| if (argc > 0) usage(); |
There was a problem hiding this comment.
This change breaks brightness -l.
Not sure what the purpose is?
There was a problem hiding this comment.
I was trying to fix an uninitialized variable warning, but I guess I made a mistake. Thanks for catching — I’ll submit a fix soon.
|
@nriley, you might want to revert the |
|
Sorry, I did not mean to commit that as is. I've got a cleanup commit incoming. |
|
OK, updated and tested on all the Macs I have access to. Hopefully this works for everyone else too. Thanks again for the contribution! |
|
tested on M1 MacBook Pro 17,1. |
|
@new3gum2 are you building from source? If so, what macOS version and are you using the internal display? |
|
Can also confirm building from source works, but was getting the same error when I installed it with |
|
Hi all, I have first tried to install brightness through Homebrew, but the app was returning an error. After compiling locally it works great, thank you guys! |
I found that these SPI functions work to get and set the brightness on my M1 MacBook Air. Fixes #34.
I have not tested this with any other system/configuration, so will need help from others to test thoroughly.
brightnessbeing uninitialized.