Closed Alexandro1112 closed 1 year ago
You're trying to call a private API, whether that works or not depends on the interface you somehow deduced. Crashes can occur when you get this wrong.
According to https://github.com/nriley/brightness/blob/master/brightness.c the function has a different interface, in particular the second argument is a pointer to float where the value is returned (o^f
) and the return value is a status code.
Describe the bug
I found a great
DisplayServices
framework and loaded it into python via pyobjc, withloadBundle
I load 1 function, for using in python.DisplayServicesGetBrightness
to determine screen brightness, exited with code 139 after running python script.Look at this:MacOs Ventura 13.1 64 arch.
To Reproduce Script should return value depending of screen brightness level.
Expected behavior Return value depending of brightness level of screen.
Additional context Earlier I use
DisplayServicesGetBrightness
for adjust brightness for determine display. Code successful adjust brightness.