gammy icon indicating copy to clipboard operation
gammy copied to clipboard

Allow monitor backlight adjustment

Open alitajelsir opened this issue 6 years ago • 7 comments

Thanks for the great app. Working well on my laptop (Matebook D 2018) and EndeavourOS. I noticed a lag in desktop (KDE) animation due to changing gamma values when moving between bright and dark backgrounds rapidly. So would it be possible to change the monitor backlight using xbacklight to change the values in /sys/class/backlight/intel_backlight/brightness for example?. Your hardwork is much appreciated.

alitajelsir avatar Mar 05 '20 12:03 alitajelsir

It's likely possible. I fear that changing backlight won't look very smooth however, since with any distro that allows to change backlight brightness via a slider, transitions look pretty grainy. But we'll see.

Also, what do you mean by lag? If you mean the time it takes for the adjustment to happen after changing windows, that's improved by increasing screenshot rate. If you mean lag during the actual adjustment, it means your system can't handle the animation. In the future I will provide a way to change the animation framerate to help with this (right now it's locked at 60).

f-fusco avatar Mar 05 '20 14:03 f-fusco

I mean the latter. The window minimize, maximize... animations. Although my laptop falls in the midrange category (i5 8th, 8GB RAM and mx150), I think you are right about it not being able to handle the animation that's why I suggested backlight changing because it's buttery smooth with gammy closed. I'll wait for the solution you think best. Hoping for the best. Thanks for your time.

alitajelsir avatar Mar 05 '20 14:03 alitajelsir

I tried to tweak the settings for my hardware by increasing the adaptation speed to 15s and so far I'm happy with the results. Thanks for the your work really. It was a hassle before to change the brightness between different backgrounds manually every time.

alitajelsir avatar Apr 12 '20 06:04 alitajelsir

FYI, there is a fork by @brunosmmm which implements backlight control. https://github.com/brunosmmm/gammy

f-fusco avatar Oct 06 '20 21:10 f-fusco

Hello, just be aware that I made that as a test and although it has been working well on my laptop, I can't guarantee that it is good enough (implementation is pretty hacky and considers only first screen returned by API without verifying any attributes). @Fushko, please weigh in if you'd like to develop this further and integrate as extra functionality. Please be aware that I have removed Xlib and use xcb instead (X.org considers Xlib as not recommended for new development, see https://www.x.org/wiki/Documentation/).

brunosmmm avatar Oct 08 '20 00:10 brunosmmm

@Fushko, please weigh in if you'd like to develop this further and integrate as extra functionality. Please be aware that I have removed Xlib and use xcb instead (X.org considers Xlib as not recommended for new development, see https://www.x.org/wiki/Documentation/).

I definitely want to migrate to XCB for the reasons you mentioned. I'll test your xcb-migrate branch. Then we'll see about integrating backlight support.

f-fusco avatar Oct 08 '20 18:10 f-fusco

@brunosmmm I rebased master on your xcb-migrate branch and pushed it here. For some reason, the gamma ramp size on XCB returns 1024, while on XLib it's 2048. This results in noticeably grainier gamma changes. The rest is fine so far.

f-fusco avatar Oct 08 '20 19:10 f-fusco