Commit Graph
87 Commits
Author SHA1 Message Date
Jon Lund Steffensen 396ecd69a8 redshift: Only print period information when it changes
This change adds functions to determine what the current period is
so we can keep track and only print the period when it changes.
2014-12-27 21:27:36 -05:00
Jon Lund Steffensen 431780b851 redshift: Be less verbose when color values did not change
This keeps a copy of the previous color_setting_t in the loop so
that we can avoid printing the color temperature and brightness if
they did not change.
2014-12-27 21:26:37 -05:00
Jon Lund Steffensen 6ecbfe324f redshift: Change duration of sleep to macro 2014-12-27 20:46:59 -05:00
Jon Lund Steffensen ec5aa19acf redshift: Simplify set_temperature by passing color_setting_t
Changes all set_temperature function in gamma adjustment methods
to take a color_setting_t pointer with the color settings.

Colorramp functions are similarly changed to take a color settings
struct.
2014-12-27 20:22:11 -05:00
Jon Lund Steffensen a4052e2a7b redshift: Add config setting to set gamma separately for day/night
These settings are gamma-day and gamma-night. The setting gamma
will still override both the daytime and nighttime gamma setting.
2014-12-27 19:43:05 -05:00
Jon Lund Steffensen 4ac4d9ee2d redshift: Move color settings into struct for period
Move color settings (temperature, gamma and brightness) into a
struct for each period (day, night). Change the interpolation
function to interpolate all values between these structs.
2014-12-27 19:43:05 -05:00
Jon Lund Steffensen c00bcff953 redshift: Use double for interpolation function 2014-12-27 19:30:16 -05:00
Jon Lund Steffensen 8839dcd530 Add CoreLocation (OSX) location provider
Similarly to the Geoclue provider, the CoreLocation provider only
requests the location on startup.
2014-12-15 20:36:35 -05:00
Jon Lund Steffensen 980a993c98 Add Quartz (OSX) gamma adjustment method 2014-12-15 20:31:51 -05:00
Jon Lund Steffensen ee7e91dd86 Fix #80: Add Geoclue2 location provider
This simply runs a GLib main loop when the location is requested
and tries to get the location from GeoClue2. We need to run a
main loop since the location is not immediately available, instead
it becomes available through a signal.
2014-12-15 01:47:49 -05:00
Jon Lund Steffensen 970e9dc624 Fix #105: Limit decimals in displayed location to two 2014-08-16 22:49:41 -04:00
Mattias Andrée 7027488b03 Fix #90: Print N/S and E/W in the location 2014-08-16 22:34:57 -04:00
Mattias Andrée 7d74a6a48c Add support for custom transition start and end elevation
Implemented through config options transition-high and transition-low (there
is no command line switch at this point). Determines at what solar elevation
Redshift will change from night to transition period to day.

Signed-off-by: Mattias Andrée <maandree@operamail.com>
2014-05-07 20:18:00 -04:00
Mattias Andrée ed9186814d Fix #41: Do not jump to 0 % or 100 % when changing direction of transition
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2014-05-07 17:16:13 -04:00
Mattias Andrée 67f479d057 Support for running Redshift without a graphical environment in Linux by using Direct Rendering Manager
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2014-03-22 19:46:11 +01:00
Mattias Andrée b2e2e4831c Free resources from config-ini.c on exit
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2014-03-13 00:29:58 +01:00
Jon Lund Steffensen d007007191 Only start "dummy" gamma method if explicitly requested 2013-12-09 14:32:08 -05:00
Jon Lund Steffensen 79bfe9eed4 Remove Gnome Clock location provider
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.
2013-12-09 14:07:01 -05:00
Jon Lund Steffensen e4034ba27d Do not allow NULL keys when setting options
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".
2013-12-09 12:28:45 -05:00
Jon Lund Steffensen 3b61f90b34 When in print mode do not start a gamma method
A gamma method is not needed in print mode
2013-12-09 10:58:43 -05:00
Jon Lund Steffensen 2d4a5ad26b Add dummy gamma adjustment method
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.
2013-12-09 10:48:45 -05:00
Jon Lund Steffensen 3297f52f48 Fix newline in help output text 2013-12-08 20:24:27 -05:00
Jon Lund Steffensen 070bf1d3de colorramp: Use new color ramp table provided by Ingo Thies.
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.
2013-10-21 22:52:38 -04:00
Jon Lund Steffensen 7abb16512e Fix typos (Benjamin Kerensa) 2013-10-21 16:05:51 -04:00
Jon Lund Steffensen d7e67a208f Fix slight wobble in temperature caused by float.
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)
2013-10-21 15:29:05 -04:00
Jon Lund Steffensen ca5e65383c Also print status on start up. 2012-02-02 18:39:54 +01:00
Jon Lund Steffensen 9b72cb363a Print status message when redshift is enabled/disabled by SIGUSR1. 2011-12-04 21:30:26 +01:00
Vincent Breitmoser 4bae608c5d add -p option for print mode.
This mode only prints the current screen parameters and exits.
Useful for quick lookup of this value for use in scripts.
2011-11-27 17:17:16 +01:00
Jon Lund Steffensen 802d09e83b Add various documentation updates: DESIGN and HACKING document, and various small comments int the source (Christian Jaeger).
Update man page with information on configuration file.
2011-10-18 18:02:28 +02:00
Jon Lund Steffensen f7d0b5fe72 Set buffering on stdout and stderr to line-buffered.
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)
2011-10-18 16:45:03 +02:00
Jon Lund Steffensen 3bd88a4307 Allow separate brightness for day and night (Olivier Fabre and Jeremy Erickson). 2011-10-18 16:01:17 +02:00
Jon Lund Steffensen acb7062f53 Fix build on windows platform. 2011-07-05 22:17:01 +02:00
Jon Lund Steffensen 220bf14ae2 Document brightness (-b) option switch. 2011-07-04 15:10:55 +02:00
Jon Lund Steffensen 3832a2fc7d Add option to show program version (-V). 2011-07-04 15:00:46 +02:00
Albert Lee 4b05bbee41 Use signal.h instead of sys/signal.h for POSIX compliance. 2011-07-04 14:20:51 +02:00
Jon Lund Steffensen ebcfda765e Merge manual mode from Joe Hillenbrand with some modifications. 2011-06-07 00:26:45 +02:00
Jon Lund Steffensen 38af3a0d5e Allow brightness to be adjusted (between 10% and 100%, the latter being the default). 2011-04-21 00:23:50 +02:00
Jon Lund Steffensen 28d553ddbb Merge Geoclue location provider by Mathieu Trudel-Lapierre with some tweaks. 2011-03-28 00:14:58 +02:00
Jon Lund Steffensen 9d7096d11c Fix: return 0 in parse_gamma_string() on success. 2011-03-27 21:37:10 +02:00
Joe Hillenbrand 494d1e03de Added feature to manually set temperature without needing location data. 2011-02-25 19:52:18 -08:00
Mathieu Trudel-Lapierre 3bf1f85267 Add first pass of Geoclue location provider. 2011-02-09 23:31:17 -05:00
Jon Lund Steffensen 5f68d4dfe4 Allow user to specify a configuration file on the command line that will
be parsed.
2010-10-18 00:58:00 +02:00
Jon Lund Steffensen 2b92b86857 Add configuration file support. 2010-10-15 12:43:48 +02:00
Jon Lund Steffensen 6f780c4063 Minor optimizations in selection of location provider and adjustment
method.
2010-10-15 00:52:19 +02:00
Jon Lund Steffensen 158de6e293 Add info on the neutral color temperature (6500K) in help output. 2010-10-09 23:04:43 +02:00
Jon Lund Steffensen e850a58909 Provide feedback on what location provider/color adjustment method that
is used when none was specifically requested.
2010-06-30 20:29:32 +02:00
Jon Lund Steffensen 222c21e5d2 Add reset option (activated with -x) that removes any color adjustments
applied to the screen. Based on patch by Dan Helfman.
2010-06-10 20:14:13 +02:00
Jon Lund Steffensen 6e5ec155d1 Add comments about certain substring which must not be translated.
Fix help text that refered to the wrong command line parameter.
2010-06-10 13:28:30 +02:00
Jon Lund Steffensen 68a0d443d6 Clarify translation of help text for translators.
Clarify comment about use of strtof().
2010-06-04 21:57:39 +02:00
Jon Lund Steffensen ba68997f7a Use lower case for method and provider names. 2010-05-27 02:22:46 +02:00