Commit Graph
242 Commits
Author SHA1 Message Date
Faheel Ahmad 6d44559b48 Limit lines to 80 chars 2017-07-29 16:36:27 +05:30
Faheel Ahmad 29727a990c Fix #474: Format help text paragraph to 80 chars max 2017-07-27 08:58:22 +05:30
Jon Lund Steffensen 6f0a0ab94f Merge pull request #420 from jonls/default-temperature
redshift.c: Use 6500K and 4500K by default
2017-01-14 12:04:12 -05:00
Jon Lund Steffensen 460cd9cab3 Merge pull request #421 from jonls/randr-adjust-multiple
XRandR: Allow multiple but not all CRTCs to be redshifted
2017-01-14 12:00:14 -05:00
Lennart Sauerbeck e02759090a XRandR: Allow multiple but not all CRTCs to be redshifted
Previously only one CRTC could be set in the configuration file for
redshifting when XRandR mechanism was being used. That is fine for
a setup with two displays but breaks when three or more displays
are in use and one of those shouldn't be redshifted (e.g. two
computer displays and one TV connected to the computer).

The config value 'crtc' for method xrandr can now be entered as
comma separated list of multiple CRTCs. All CRTCs in the list will
be redshifted while all those not in the list will not be touched.
2017-01-08 17:51:18 -05:00
Jon Lund Steffensen d7b7caf990 redshift.c: Use 6500K and 4500K by default 2017-01-08 15:44:58 -05:00
Arne Janbu 7342a3b06c Fix Windows build after e0a617fcad 2016-10-19 22:39:58 +02:00
Jon Lund Steffensen 90849caf41 Merge pull request #383 from jonls/icon-tooltip
add display of color temperature and period in the tooltip status icon
2016-10-15 12:16:47 -04:00
Andreev Alexander 1fb3275605 add display of color temperature and period in the tooltip status icon 2016-10-15 12:08:49 -04:00
Jon Lund Steffensen 05737ed33c drm: Avoid using alloca() 2016-10-15 11:38:20 -04:00
Jon Lund Steffensen 7e9ef55987 redshift-gtk: Make sure that child process is closed after signals
Instead of calling sys.exit() the signal handlers now try to terminate
the child process. After the child exits, the process will be reaped by
the GLib callback which will call Gtk.main_quit() which will then quit
redshift-gtk. This ensures that the redshift process does not outlive
the redshift-gtk process.
2016-01-02 16:48:48 -05:00
Jon Lund Steffensen 71f52b7cd7 Fix #213: Merge branch 'pull-213' 2015-12-28 11:35:53 -05:00
Mattias Andrée e0a617fcad Move signal processing functions and sigaction calls to signals from redshift.c
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2015-12-28 11:31:42 -05:00
Jon Lund Steffensen a53dddb535 Merge pull request #244 from jubalh/master
Remove trailing whitespaces
2015-12-28 11:02:56 -05:00
Javier Cantero ae2e23325b Fallback if AppIndicator3 req. version unavailable
Catch in the except block the case when the required version of
Appindicator3 is not available to also fallback in GtkStatusIcon widget.
2015-11-15 12:05:45 +01:00
Javier Cantero 56cef8d9cc Also specify required AppIndicator3 version
Avoid another GObject Introspection warning in redshift-gtk by providing
the required version of AppIndicator3 before import it.
2015-11-14 12:09:34 +01:00
Christian Stadelmann 442fb9bd5d Specify required Gtk version
This fixes a warning when starting redshift-gtk with gtk 3.18.
2015-11-03 19:18:51 +01:00
Michael Vetter 6b61e3f9e4 Remove trailing whitespaces 2015-08-04 14:01:37 +02:00
Jon Lund Steffensen 5f26b3d396 Merge pull request #197 from forivall/clamp-fix
Fix clamp issues
2015-05-10 20:34:47 -04:00
Mattias Andrée 6954f21fd4 remove unnecessary null-checks, it is safe to pass NULL to free (per documentation)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
2015-05-07 17:52:27 +02:00
Jordan Klassen ba15832b9e Fix CLAMP macro overwritten by glib headers
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.
2015-05-02 12:35:05 -07:00
Jon Lund Steffensen 8b0a67a253 Fix #174: Use nanosleep() instead of usleep()
usleep() cannot sleep for more than 1000000 microseconds on certain
platforms. nanosleep() does not have this limitation.
2015-02-22 11:51:22 -05:00
Jon Lund Steffensen 731a7d2cd5 Fix #162: Ensure that interpolation alpha is in [0;1] 2015-01-15 09:37:31 -05:00
Christian Burger 8dbeda906a fixes jonls/redshift#157 introduced by jonls/redshift@f9c2a1568c 2015-01-10 12:32:04 +01:00
Jon Lund Steffensen 8d5cf30b4d redshift: Add print_location() function 2015-01-04 17:48:10 -05:00
Jon Lund Steffensen 699e25b33c w32gdi: Add preserve option to windows GDI method 2015-01-04 16:34:34 -05:00
Jon Lund Steffensen aaf455c9ae vidmode: Add preserve option to VidMode method 2015-01-04 16:34:33 -05:00
Jon Lund Steffensen d32314f8cc quartz: Add preserve option to Quartz method
This change adds the preserve option to the quartz method which makes it
base the temperature adjustments on the existing gamma ramps when set. This
requires that the existing gamma ramps are saved at start-up which this
commit also adds.

One drawback is that the list of displays is enumerated at start-up now which
means that Redshift will likely not affect displays that are connected after
start-up. This could be fixed in the future by listening to reconfiguration
events.
2015-01-04 16:34:33 -05:00
Jon Lund Steffensen 77e2c3b88b randr: Add preserve option to RandR method 2015-01-04 16:34:33 -05:00
Jon Lund Steffensen 9b299132ef colorramp: Use supplied gamma ramps as initial value
This changes colorramp_fill() to base the ramp calculations on the
existing values in the supplied tables, instead of basing it on a pure
`i/size` value computed on the fly.

All gamma adjustment methods are changed to explicitly initialize the ramps
to the `i/size` value before calls to colorramp_fill().
2015-01-04 16:34:33 -05:00
Jon Lund Steffensen 017fc230be redshift: Add gamma_is_valid function to check gamma
This checks whether the gamma values are within the bounds of
MIN_GAMMA and MAX_GAMMA.
2015-01-04 16:32:47 -05:00
Jon Lund Steffensen bb61a25e88 redshift: Add transition scheme type with color settings
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.
2015-01-04 16:32:47 -05:00
Jon Lund Steffensen c2f0ca4647 redshift: Make transition levels parameter to related functions
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.
2015-01-04 16:32:47 -05:00
Jon Lund Steffensen f9c2a1568c redshift: Move continual loop mode to separate function 2015-01-04 16:32:47 -05:00
Jon Lund Steffensen 799b08214d Add location_t type with lat/lon fields 2015-01-04 16:32:47 -05:00
Jon Lund Steffensen 0cc785c730 redshift: Add noop pause() macro on windows platform
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.
2015-01-04 14:53:16 -05:00
Jon Lund Steffensen bd086885a5 Fix #152: redshift: Loop in reset/manual/one-shot mode with Quartz
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.
2015-01-04 13:50:53 -05:00
Jon Lund Steffensen f7dd7addd8 Fix #153: geoclue2: Set desktop id on GeoClue2 client
This property needs to be set in the latest versions of GeoClue2,
but it is not available in early versions.
2015-01-02 22:42:16 -05:00
Jon Lund Steffensen 542254705b redshift: Fix untranslated status strings 2014-12-30 22:08:06 -05:00
Jon Lund Steffensen 59023d86f4 Merge branch 'hooks-dir' 2014-12-28 19:26:29 -05:00
Jon Lund Steffensen f154aaa7c1 redshift: Add translation comment on period name None 2014-12-28 14:34:43 -05:00
Jon Lund Steffensen 0b94ec26fe redshift: Add translation of Daytime/Night in new gamma string 2014-12-28 14:34:21 -05:00
Jon Lund Steffensen d281e0c1ed redshift: Add translation comment to N,S,W,E strings 2014-12-28 14:33:11 -05:00
Jon Lund Steffensen 501d308495 location: Make translated string about recheck shared between all providers 2014-12-28 14:14:28 -05:00
Jon Lund Steffensen 7cb1af0773 corelocation: Fix missing space character in string 2014-12-28 14:13:42 -05:00
Jon Lund Steffensen ba422bd78e systemtime: Add function wrapping platform sleep function
Adds systemtime_msleep() which sleeps for a number of milliseconds.
This wraps Sleep() on windows and usleep() on other platforms.
2014-12-28 13:13:21 -05:00
Jon Lund Steffensen 4adf25952f systemtime: Fix includes and check for _POSIX_TIMERS
Fix missing include of windows.h on windows platform. Change check
for _POSIX_TIMERS to check that it is greater than 0. On OS X, the
POSIX timers are not available and _POSIX_TIMERS is -1.
2014-12-28 13:10:31 -05:00
Jon Lund Steffensen 159754c1cd redshift: Add hooks for user actions on period switch
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".
2014-12-28 01:36:26 -05:00
Jon Lund Steffensen 4a572e85e9 redshift: Move period_t to header 2014-12-28 01:30:35 -05:00
Jon Lund Steffensen d58de55645 redshift: Add enum member for unknown period_t (PERIOD_NONE) 2014-12-28 01:25:10 -05:00