FedeDP / Clight

A C daemon that turns your webcam into a light sensor. It will adjust screen backlight based on ambient brightness.
GNU General Public License v3.0
722 stars 27 forks source link

Add ability for smooth backlight change #20

Closed asm0dey closed 6 years ago

asm0dey commented 6 years ago

I would prefer macbooklike style of brightness correction. e.g change from brightness 2000 to brightness 3000 in 5 seconds

FedeDP commented 6 years ago

It would be nice (and it already exists for dimmer) yeah, but given that lots of people only have something like 10 backlight steps, and that usually backlight is lowered/raised up of very little, it would be useless in most cases. It exists for dimmer where usually backlight is dimmed much more.

asm0dey commented 6 years ago

I can only say about my laptop:

cat /sys/class/backlight/intel_backlight/max_brightness
7500

I would propose to add optional parameter if that's possible. Also, it may be reasonable to look if there is more then 10 steps to change and if yes — then change backlight level smoothly.

asm0dey commented 6 years ago

Also, it may be reasonable to change, say, 1 step per second. guys with 15 steps will have immediate results, guys with lots of steps will have a smooth adaptation of screen.

FedeDP commented 6 years ago

I'll look into this :) I was working on another thing in clight that right now has top priority (and as soon as i got time i'll finish this): support for desktop PCs (and external HDMI monitor) through ddcutil. It is quite there (devel branch) but it still needs some fixes in clightd. After that feature is in place, i'll start looking into this.

Btw any patch is really welcome :)

FedeDP commented 6 years ago

@asm0dey On devel branch you can find backlight smooth transitions. If you're willing to test it (and help testing clight too for next release), you can build devel branch. Remember that you also need clightd from "ddcutil" branch ;)

Let me know if you encounter any issue!

asm0dey commented 6 years ago

@FedeDP will clightd from master work for me?

asm0dey commented 6 years ago

I've got following error: Unknown property or interface without any clue of what property it doen't like

FedeDP commented 6 years ago

You should use clightd built from ddcutil branch! Once some tests is done i'll merge both branch in master(for clight and clightd).

EDIT: that is not obvious though: clightd must be properly installed (with sudo make install)as otherwise its bus interface is not exported.

asm0dey commented 6 years ago

@FedeDP I've installed it exactly that way. But getting error Unknown property or interface

FedeDP commented 6 years ago

This is weird. Mind to share your /usr/share/polkit-1/actions/org.clightd.backlight.policy? Moreover, this seems like a clight/clightd versions mismatch. Are you really sure you're running correct versions? Mind to share how you are building and starting both clight and clightd? Thanks!

FedeDP commented 6 years ago

Fixed in https://github.com/FedeDP/Clight/commit/4f8efac147dec513bde4f61379b95bc537723ad3.