LinkBrightness icon indicating copy to clipboard operation
LinkBrightness copied to clipboard

{Request} Delay before setting brightness

Open ritujb opened this issue 6 years ago • 8 comments

Is it possible to add an option to set the saved brightness after a set Delay such that critical programs (MSI dragon center in my case) which don't let this program work properly can be used in conjuction with it.

I use Dragon Center to set a manual fan control hence it is necessary.

Something like:: Load current brightness level(also monitor brightness change) -> Wait for power source change event -> Source Changed -> Delay -> Set the previously loaded brightness value for current source

Hope you can impement this.

ritujb avatar Sep 05 '18 14:09 ritujb

If there is another program setting the brightness there will be a race condition.

jay avatar Sep 06 '18 03:09 jay

Yeah I know. I will manually determine after how much time the other program sets the brightness and then set a delay just greater than that time, so that this program can set the desired brightness.

ritujb avatar Sep 06 '18 03:09 ritujb

What I'm saying though is there is still a race condition. I suggest if you don't like what the other program is doing with your brightness then contact them and ask for a way to disable that feature.

jay avatar Sep 06 '18 04:09 jay

I don't understand. Why would there be still a race condition if we set the brightness after the other program has already done its deed.

The program itself doesn't have any control for brightness, I just found that when I close it, then your program runs properly.

ritujb avatar Sep 06 '18 04:09 ritujb

There's just no guarantee if another program is also changing the brightness. You're assuming it will already be done. The program may still set the brightness after (or again, after).

jay avatar Sep 06 '18 04:09 jay

I assure you that it won't. It only changes changes brightness after approx 1 seconds of a power source event is detected. If you can modify this program to add a custom delay through command line options, I can overcome that.

ritujb avatar Sep 06 '18 04:09 ritujb

NVM, I have done it using AutoIt

ritujb avatar Sep 06 '18 05:09 ritujb

Ok. I went ahead and implemented the option in branch opt_syncdelay (diff) in my repo. In my opinion delaying the sync is a bad idea and should not be added to the official version.

jay avatar Sep 06 '18 07:09 jay