-
Notifications
You must be signed in to change notification settings - Fork 594
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
Hammerspoon Intermediate Gamma Issues #1428
Comments
Having looked into the source code, the issue seems to come from here. |
I think I see why this is happening, and I think you could work around it the following:
Hope that helps! |
Yeah, I managed to find a work around. Unfortunately the solution you suggested will not work. Say for example, the previous gamma was set to .5, and then I disconnected and reconnected the monitor. I can call restoreGamma (actually it appears to be called automatically), which will restore the gamma to 1. However, when the screen was attached, hammerspoon retreives the gamma value of .5, and stores that as the original gamma. Thus when I try to adjust the gamma to say .5 again with setGamma, it will put it at .25.
This solution is pretty hacky, and it seems to me like the behavior of setGamma is inconsistent. If I call screen:setGamma(screen:getGamma['whitepoint'], screen:getGamma['blackpoint']), ideally there should be no change, but with the current logic, if the original gamma is not 1, then there will be changes. Is there some use case for multiplying by the original gamma, instead of the gamma capacity? |
Hi,
I've been playing around with a method to increase and decrease the "brightness" of my external monitor with keyboard shortcuts via using hs.screen.getGamma and hs.screen.setGamma to increase or decrease the whitepoint rgb values of my monitor, giving the same effect as changing the brightness. Unfortunately, there seems to be some issues with api, when it comes to reloading the config, or disconnecting and reconnecting the monitor. For example, if I lower the gamma values on my monitor to .5, disconnect the monitor, and then reconnect the monitor it restores the white point rgb values to 1. That part is fine, but the problem is that if I then try to adjust the gamma values, the screen instantly dims, and the max value I can set it at is now .5. To fix the issue, I have to call restoreGamma, and then reload my script. setGamma seems to be capping the values for some reason, based on the current gamma value of the monitor. This issue seems to be related to #917 and I'm wondering if there's anyway to fix this, or any workarounds that could work without requiring the script to be reloaded everytime.
The text was updated successfully, but these errors were encountered: