jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.87k stars 424 forks source link

Allow hooks to transition smoothly #839

Open navid-zamani opened 3 years ago

navid-zamani commented 3 years ago

Current situation Right now, hooks only get informed on period changes. They are not updated with the transition state.

Problem This makes it impossible, to implement a smooth transition, e.g. of the screen backlight, keyboard backlight, theme colors, background images, and all the other things redshift doesn't do.

Solutiion It would be nice if hooks could get such updates, right as they happen. (Once a second?)

To make this efficient, and not call a lot of processes, may I suggest using the hook's stdin to send perdecimilles [0..10000] followed by newlines. This makes is very easy for scripts to handle.

Alternative An alternative solution might be, to make redshift modular (but in a Unixy way that makes things easy for you aswell as module creators, and not in a nasty frameworky way). Ideally, redshift would use an architecture similar to cron or udev, and/or just become modules for those existing packages, and fire off events that the various modules would use. A color temperature module, a screen brightness module, and so on. All simple script files in a simple /etc/cron.d/-like directory. (In that case, a nice fifo that behaves like /sys/class/backlight/intel_backlight/brightness or the like could be used to let scripts read the current transition state.) The frontends would just be frontends, controlling that daemon (or service on Windows). So that CLI and GUI implementations wouldn't conflict while trying to compete, as they do now.

Context This, specifically, is a fully updated Linux Mint installation. Using redshift-gtk 1.12-linuxmint3.