Try to set the process title during startup. Before, redshift-gtk appeared as a python process.
This change enables `pgrep redshift-gtk` or `killall redshift-gtk`.
This allows redshift-gtk to show the current state of the redshift
process. redshift-gtk follows the enable state of redshift and toggles
the icon accordingly.
The implementation is changed to use glib to spawn the child process
instead of relying on python subprocess module. This is necessary
because of inflexibility in the python module.
This was basically a hack that happened to work because the Gnome Clock
applet could store the current location of the user, and Redshift was able
to fetch this location through GConf. Since Redshift for some time now has
supported a config file where the location can be set, there is not really
any reason to use an external, fragile solution to do the same.
This should fix a bug where command line options for the "manual" location
provider cannot override the config file. To keep compatability with previous
versions the command line parser will still special case parsing "-l LAT:LON"
and set the correct options in "manual".
This method does not do anything but print the temperature to the terminal.
An external program implementing a color temperature adjustment scheme that
is not supported by redshift can use this method to determine the desired
color temperature. It is also useful for testing other parts of redshift on
systems where neither RandR nor VidMode works.
This table is calculated by the actual Planckian locus below 5000K, and by CIE daylight standard above 5000K.
Also, the new table applies proper gamma correction according to sRGB.
More information can be found in README-colorramp.
Values generated by colorramp_fill() will be a maximum of i * 256 - 1, due to the use of UINT16_MAX. Simplest fix ought to be using (UINT16_MAX+1), which is safe, as the maximum value (255 * 256) still fits in a uint16.
(Thanks to Sean Hildebrand)
The transition variable 'adjustment_alpha' is a float. Redshift will wobble between 6499 and 6500K as the float runs out of precision. Using a double seems to solve the issue.
(Thanks to Sean Hildebrand)
This is primarily for improved discovery. Some users report that they didn't know about redshift-gtk, but had it been available on tab completion they would have noticed. Also, I think it is in general good practice that closely related programs have the same prefix.
Previously stdout would be block buffered and stderr unbuffered when writing to a non-terminal.
This code works on Debian with libc 2.11.2. The man page of setvbuf mentions that NULL can be used to avoid affecting the used buffer, but doesn't mention whether the size argument is then ignored; testing on Debian has revealed that this code works as intended, but I don't know whether that's standard.
(Christian Jaeger)