aboutsummaryrefslogtreecommitdiffstats
path: root/src/redshift.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* redshift: Improve fade implementationJon Lund Steffensen2017-08-301-117/+164
| | | | | | | | | | Simplify implementation of fades in continual mode. A fade is now applied anytime the change in color temperature, brightness or gamma is greater than a preset threshold. This means that a fade is applied if the location provider suddenly updates to a new location or if the currently time suddenly jumps e.g. after waking up the computer from sleep. An easing function is applied to the fade to make it more pleasant.
* Change term transition to fadeJon Lund Steffensen2017-08-301-20/+19
| | | | | | | | | Use the term "fade" instead of "transition" for the short (~5s) fade between color temperatures. The term "transition" is now only used for the transition phase between daytime and night. The setting "transition" in the configuration file is now deprecated and "fade" should be used instead.
* geoclue2: Update continuouslyJon Lund Steffensen2017-08-171-0/+3
|
* corelocation: Update continuouslyJon Lund Steffensen2017-08-171-0/+3
|
* Change location providers to allow updatesJon Lund Steffensen2017-08-171-65/+233
| | | | | | | Change location provider implementations so it is possible for location providers to dynamically update the location. This commit adds the interfaces and infrastructure in redshift.c but none of the location provides are changed to become dynamic.
* Remove deprecated geoclue 1 location providerJon Lund Steffensen2017-08-161-21/+0
|
* Limit lines to 80 charsFaheel Ahmad2017-07-291-4/+4
|
* Fix #474: Format help text paragraph to 80 chars maxFaheel Ahmad2017-07-271-4/+3
|
* redshift.c: Use 6500K and 4500K by defaultJon Lund Steffensen2017-01-081-2/+2
|
* Move signal processing functions and sigaction calls to signals from redshift.cMattias Andrée2015-12-281-72/+6
| | | | Signed-off-by: Mattias Andrée <maandree@operamail.com>
* Merge pull request #197 from forivall/clamp-fixJon Lund Steffensen2015-05-101-7/+3
|\ | | | | Fix clamp issues
| * Fix CLAMP macro overwritten by glib headersJordan Klassen2015-05-021-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #188 When I moved the macro definition below all of the includes, I got the following compiler warning: /usr/include/glib-2.0/glib/gmacros.h:246:0: note: this is the location of the previous definition #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) So, that's the macro definition that was being used whenever "CLAMP" was used. It's pretty obvious what went wrong.
* | remove unnecessary null-checks, it is safe to pass NULL to free (per documentation)Mattias Andrée2015-05-071-2/+2
|/ | | | Signed-off-by: Mattias Andrée <maandree@operamail.com>
* Fix #162: Ensure that interpolation alpha is in [0;1]Jon Lund Steffensen2015-01-151-3/+5
|
* fixes jonls/redshift#157 introduced by jonls/redshift@f9c2a1568c308ec69970662a8f5ceb8726e8d8ccChristian Burger2015-01-101-2/+2
|
* redshift: Add print_location() functionJon Lund Steffensen2015-01-041-17/+22
|
* redshift: Add gamma_is_valid function to check gammaJon Lund Steffensen2015-01-041-12/+15
| | | | | This checks whether the gamma values are within the bounds of MIN_GAMMA and MAX_GAMMA.
* redshift: Add transition scheme type with color settingsJon Lund Steffensen2015-01-041-125/+122
| | | | | | | This changes the transition_levels_t to transition_scheme_t and adds two fields day, night of type color_setting_t. This encapsulates all the information needed to calculate the current color setting from an elevation.
* redshift: Make transition levels parameter to related functionsJon Lund Steffensen2015-01-041-33/+56
| | | | | | Moves transition_low and transition_high from globals into a struct transition_levels_t that is created in main and passed to the relevant functions.
* redshift: Move continual loop mode to separate functionJon Lund Steffensen2015-01-041-222/+241
|
* Add location_t type with lat/lon fieldsJon Lund Steffensen2015-01-041-9/+11
|
* redshift: Add noop pause() macro on windows platformJon Lund Steffensen2015-01-041-0/+5
| | | | | | Build failed on windows platform since pause() is not available. The function is not needed on the windows platform so we just define a noop pause() macro.
* Fix #152: redshift: Loop in reset/manual/one-shot mode with QuartzJon Lund Steffensen2015-01-041-0/+23
| | | | | | | The gamma adjustments made with the Quartz (OSX) method are tied to the process so when we exit, the gamma adjustments are reset. Therefore we need to run a loop that breaks on CTRL-C, after the gamma adjustments are made.
* redshift: Fix untranslated status stringsJon Lund Steffensen2014-12-301-3/+3
|
* Merge branch 'hooks-dir'Jon Lund Steffensen2014-12-281-8/+19
|\
| * redshift: Add hooks for user actions on period switchJon Lund Steffensen2014-12-281-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | Hooks are executable scripts in ~/.config/redshift/hooks/ that are run when a certain event happens. The first parameter to the script indicates the event and further parameters may indicate more details about the event. The event "period-changed" is indicated when the period changes ("night", "daytime", "transition"). The second parameter is the old period and the third is the new period. The event is signaled when Redshift starts up with the old period set to "none".
| * redshift: Move period_t to headerJon Lund Steffensen2014-12-281-8/+0
| |
* | redshift: Add translation comment on period name NoneJon Lund Steffensen2014-12-281-0/+1
| |
* | redshift: Add translation of Daytime/Night in new gamma stringJon Lund Steffensen2014-12-281-2/+4
| |
* | redshift: Add translation comment to N,S,W,E stringsJon Lund Steffensen2014-12-281-3/+16
| |
* | systemtime: Add function wrapping platform sleep functionJon Lund Steffensen2014-12-281-8/+5
|/ | | | | Adds systemtime_msleep() which sleeps for a number of milliseconds. This wraps Sleep() on windows and usleep() on other platforms.
* redshift: Add enum member for unknown period_t (PERIOD_NONE)Jon Lund Steffensen2014-12-281-2/+5
|
* redshift: Properly handle errors in sigactionJon Lund Steffensen2014-12-281-4/+19
|
* redshift: Fix translation of period namesJon Lund Steffensen2014-12-271-5/+9
| | | | | | The static string array period_names contains strings that are printed but these were not marked for translation. This is fixed now by adding the _N() macro and calling gettext() when the strings are used.
* redshift: Only print period information when it changesJon Lund Steffensen2014-12-271-9/+65
| | | | | This change adds functions to determine what the current period is so we can keep track and only print the period when it changes.
* redshift: Be less verbose when color values did not changeJon Lund Steffensen2014-12-271-2/+20
| | | | | | 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.
* redshift: Change duration of sleep to macroJon Lund Steffensen2014-12-271-5/+8
|
* redshift: Simplify set_temperature by passing color_setting_tJon Lund Steffensen2014-12-271-10/+8
| | | | | | | | 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.
* redshift: Add config setting to set gamma separately for day/nightJon Lund Steffensen2014-12-271-1/+25
| | | | | These settings are gamma-day and gamma-night. The setting gamma will still override both the daytime and nighttime gamma setting.
* redshift: Move color settings into struct for periodJon Lund Steffensen2014-12-271-70/+119
| | | | | | 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.
* redshift: Use double for interpolation functionJon Lund Steffensen2014-12-271-4/+4
|
* Add CoreLocation (OSX) location providerJon Lund Steffensen2014-12-151-0/+18
| | | | | Similarly to the Geoclue provider, the CoreLocation provider only requests the location on startup.
* Add Quartz (OSX) gamma adjustment methodJon Lund Steffensen2014-12-151-0/+19
|
* Fix #80: Add Geoclue2 location providerJon Lund Steffensen2014-12-151-1/+19
| | | | | | | 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.
* Fix #105: Limit decimals in displayed location to twoJon Lund Steffensen2014-08-161-1/+1
|
* Fix #90: Print N/S and E/W in the locationMattias Andrée2014-08-161-2/+4
|
* Add support for custom transition start and end elevationMattias Andrée2014-05-071-9/+30
| | | | | | | | 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>
* Fix #41: Do not jump to 0 % or 100 % when changing direction of transitionMattias Andrée2014-05-071-55/+26
| | | | Signed-off-by: Mattias Andrée <maandree@operamail.com>
* Support for running Redshift without a graphical environment in Linux by using Direct Rendering ManagerMattias Andrée2014-03-221-0/+19
| | | | Signed-off-by: Mattias Andrée <maandree@operamail.com>
* Free resources from config-ini.c on exitMattias Andrée2014-03-131-0/+2
| | | | Signed-off-by: Mattias Andrée <maandree@operamail.com>