Skip to content

[Feature request]: Add gamma control #94

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

Open
pyt0xic opened this issue Jan 27, 2024 · 14 comments
Open

[Feature request]: Add gamma control #94

pyt0xic opened this issue Jan 27, 2024 · 14 comments

Comments

@pyt0xic
Copy link

pyt0xic commented Jan 27, 2024

Please describe your feature request

Add the ability to set screen temperature based on sunset/sundown and manually specified times.

See #91

@maximbaz
Copy link
Owner

One of the biggest questions is to figure out what we can do differently and better than gammastep. I don't think we should reimplement and compete with it just for the sake of it.

Our competitive advantage is that we have access to screen content, and optionally als. Is it enough to predict the best possible screen temperature?

@pyt0xic
Copy link
Author

pyt0xic commented Jan 27, 2024

Hmm, I think adjusting the gamma based on light levels would be quite cool.
In terms of screen content, it could maybe adjust it based on the amount of dark/light content. I'm not sure how beneficial that would be. 😅

@maximbaz
Copy link
Owner

Maybe... On the other hand, isn't it in some sense preferable to "force" warm colors in the evening, to prepare your brain for sleep in advance, rather than keeping your screen blue just because you keep bright lights on, thereby feeding the vicious cycle that leads to staying awake until much too late? 😅😆

@pyt0xic
Copy link
Author

pyt0xic commented Jan 28, 2024

Very true. 😂
One thing that I would like and I believe @name-snrl would be interested in as well is the ability to specify temperatures for certain times.

The sun rises very early here, but it becomes significantly brighter around 10am, so it would be nice to have more control over the "transitional" periods. I hope that makes sense...

@maximbaz
Copy link
Owner

To continue playing the devil's advocate, wouldn't configuring the curve be better suited for gammastep project? They already have all the code ready and battle-tested, and it should be a small adjustment to teach it how to have a better transition curves?

By the way, there's lots of project doing that, most recently I was using wlsunset instead of gammastep (my current hardware does not support wlr-gamma-control-unstable-v1 😭 )

@name-snrl
Copy link
Contributor

name-snrl commented Jan 29, 2024

Our competitive advantage is that we have access to screen content, and optionally als. Is it enough to predict the best possible screen temperature?

I'm not sure of the prediction, but I think that by adding gamma functionality to wluma we will be able to adjust brightness more finely. e.g. with warm colors, white is less annoying at the same brightness level

I mean, it would be great to have two trainable models, one for warm colors and one for normal colors.

@maximbaz
Copy link
Owner

Now that is a very interesting and tempting idea to explore, that a screen color would allow for a finer tuning and therefore better predictions. Do you think you would want warmer colors during the day? You lose potentially correctness of colors...

@name-snrl
Copy link
Contributor

name-snrl commented Jan 29, 2024

Do you think you would want warmer colors during the day?

Nah, I don't need this. All I want I've described here #91 (comment)

@pyt0xic
Copy link
Author

pyt0xic commented Feb 3, 2024

Now that is a very interesting and tempting idea to explore, that a screen color would allow for a finer tuning and therefore better predictions.

I really like this idea!

Do you think you would want warmer colors during the day? You lose potentially correctness of colors...

I use slightly warmer colors during the day, I stare at a terminal most of the time and I find it helps prevent eye strain.

I think I've worked out how to use the Wayland gamma control protocol, I'll add it to my fork as soon as I am able to set the gamma 😆

@jficz
Copy link

jficz commented Mar 16, 2025

I'd be happy with just relative gamma adjustment (i.e. "brightness"), not necessarily color temperature. My use case is an external display which is very bright even at lowest settings and adjusting gamma is the only way to dim it further.

Think of it as an alternative "fallback" solution to DDC.

@maximbaz
Copy link
Owner

I definitely think the current approach of how brightness is managed could be easily cloned to handle gamma (basically a separate model that tracks when you make changes to gamma, records the desired gamma along with optionally the current ambient light and screen content "whiteness", and then continuously predicts and sets it).

Unfortunately my hardware still doesn't support wlr-gamma-control-unstable-v1, so I'm not able to give it a go.

PRs are very welcome, if someone wants to try 🙂 I'd suggest starting from main.rs, see how it initializes the current brightness predictor, likely we'd have a similar block for gamma predictor, and then it's all about following the same architecture to create corresponding new files. Happy to discuss specifics or answer questions if there is interest.

@pyt0xic
Copy link
Author

pyt0xic commented Mar 17, 2025

I'd be happy with just relative gamma adjustment (i.e. "brightness"), not necessarily color temperature. My use case is an external display which is very bright even at lowest settings and adjusting gamma is the only way to dim it further.

Think of it as an alternative "fallback" solution to DDC.

Can you not use DDC/CI?
Check out ddcutil....

@jficz
Copy link

jficz commented Mar 18, 2025

Can you not use DDC/CI?

Not really, even with the ddcci driver the interface is buggy. The external monitor is randomly (not)detected by ddcutil and sometimes doesn't even come up when ddcci module is loaded.

Might be related to the fact that the monitor is in fact a full USBC dock.

@jficz
Copy link

jficz commented Apr 16, 2025

So ddc "somehow" works after applying a bit of dark magic but the problem remains - even the lowest brightness settings of the monitor is too bright.

Also, settings per sun up/down based on (even hardcoded) geolocation would be cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants