Commit Graph
280 Commits
Author SHA1 Message Date
Jon Lund Steffensen 2da3bf2680 Fix issue where quartz did not mark as unavailable 2018-05-20 17:55:45 -07:00
Masanori Kakura 9ff0501e78 config-ini: Properly respect XDG_CONFIG_HOME base directory specification
If redshift.conf is not found, fall back to formerly used path.
2018-05-04 22:58:54 +09:00
Matt Stobo a4d89c7d6b Fix #335: Set period to none when disabled
This allows for hooks to be run when redshift is disabled
2017-10-30 19:38:41 -04:00
Jon Lund Steffensen 8197f35943 options: Split parse functions 2017-10-19 15:52:16 -07:00
Jon Lund Steffensen e075444663 Change preserve option to command line switch
Changes each adjustment method to take a preserve parameter when
setting the temperature instead of parsing the preserve option
from the command line/configuration file. This helps resolve the
issues around #513:

- This allows the preserve option to be implemented as a
  command-line switch (-P). This switch _disables_ the preservation
  of existing gamma ramps. Having a command-line switch makes it
  easier to use directly with manual or one-shot mode.
- The preserve options is on by default, so continual mode as well
  as other modes will default to applying the color adjustment
  on top of the current gamma ramps.
- Preserve is always disabled in reset mode so resetting works
  as expected again.
2017-10-13 19:08:57 -07:00
Jon Lund Steffensen 55455f99d9 Add function for resetting color_setting_t 2017-10-13 18:12:44 -07:00
Jon Lund Steffensen 3e0fef4e8d Move options handling to separate file
Create options.c which contains functions for initializing and
parsing options from the command line and the configuration file.
Program options that were previously local variables in main() are
moved to the options_t struct.
2017-10-13 18:12:44 -07:00
Jon Lund Steffensen 1d29f92349 Move module structures out of headers 2017-10-13 18:12:43 -07:00
Jon Lund Steffensen b27acd6878 Allocate module data in init functions 2017-10-13 18:09:28 -07:00
Jon Lund Steffensen 6531b8c73d Move module struct definitions to separate files 2017-10-13 17:53:58 -07:00
Samuel Walladge a172e1815d add help message to redshift-gtk 2017-10-13 16:10:32 -07:00
Jon Lund Steffensen e2d1b5d9cd quartz: Fix incorrect use of display identifier
The quartz (macOS) adjustment method incorrectly used the display
index instead of the associated CGDirectDisplayID. Incidentally this
happened to work too but was incorrect.
2017-10-12 18:27:43 -07:00
Jon Lund Steffensen 86bb509eca Fix bug where error code was not handled 2017-10-12 14:01:28 -07:00
Jon Lund Steffensen 64600ae55d Fix missing checks and verbose output
Rearrange checks and verbose output in main() to bring back checks
that were accidentally left out when time-based adjustments were
enabled. This includes the output indicating the daytime/night
temperatures and the check that the temperatures are valid.
2017-10-12 12:36:39 -07:00
Jon Lund Steffensen 1e425c66f5 Time-based configuration
Allow setting the time of the dawn and dusk transition periods
directly in the configuration file. If these are specified, the
location provider is not needed and is therefore not initialized.

Based on patch by Martin Nicolay <edelschimmel1@gmx.de>.
2017-10-11 14:45:59 -07:00
dev7355608 d9d7218cc8 Fix #523: Retry SetDeviceGammaRamp before giving up
We have to retry SetDeviceGammaRamp a few times before giving up
because some buggy drivers fail on the first invocation just to
succeed on the second.
2017-09-27 16:20:47 +02:00
Jon Lund Steffensen d0135df859 w32gdi: Enable preserve by default 2017-08-31 01:54:09 -07:00
Jon Lund Steffensen 989fe52176 vidmode: Enable preserve by default 2017-08-31 01:53:59 -07:00
Jon Lund Steffensen dcafe503d3 randr: Enable preserve by default 2017-08-31 01:53:49 -07:00
Jon Lund Steffensen ce430bb52e quartz: Enable preserve by default 2017-08-31 01:53:39 -07:00
Jon Lund Steffensen d8f04b9020 redshift: Improve fade implementation
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.
2017-08-30 17:12:56 -07:00
Jon Lund Steffensen a33d5e237e Merge pull request #507 from jonls/fade-term
Use the term "fade" instead of "transition" for the short (~5s) fade between color temperatures
2017-08-30 17:04:22 -07:00
Jon Lund Steffensen 8165badbc2 Change term transition to fade
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.
2017-08-30 15:21:43 -07:00
Jon Lund Steffensen c4e0f3aa5a geoclue2: Show explanation of access denied error 2017-08-19 17:39:05 -07:00
Jon Lund Steffensen 52d9a73d36 geoclue2: Use existing connection object
Use existing connection object when creating proxies.
2017-08-19 17:37:49 -07:00
Jon Lund Steffensen 00e2d538e8 geoclue2: Update continuously 2017-08-17 20:24:32 -07:00
Jon Lund Steffensen df10508e30 corelocation: Update continuously 2017-08-17 20:24:32 -07:00
Jon Lund Steffensen ce037545dd pipeutils: Add utils for pipe signals
Add pipeutils.c with utility functions for working with pipes as
signals across threads. Using pipes for signals makes it easy for
the main thread to wait on (multiple) file descriptors with or
without a timeout.
2017-08-17 19:52:29 -07:00
Jon Lund Steffensen 153dec0e21 Change location providers to allow updates
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.
2017-08-17 19:52:29 -07:00
Jon Lund Steffensen 4adb93a448 Remove deprecated geoclue 1 location provider 2017-08-16 20:46:53 -07:00
Jon Lund Steffensen 74759e8dfb Fix #492: Correctly import xdg modules
Although not named like modules, the BaseDirectory and
DesktopEntry are really submodules of xdg that need to be imported
for them to be available.
2017-08-07 12:20:49 -07:00
Jon Lund Steffensen 329873efd1 Merge pull request #490 from jonls/windows-resources
Add icon for Windows build
2017-08-01 00:54:21 -07:00
Jon Lund Steffensen a39e92cc4b statusicon: Use GtkWindow to avoid warnings
Avoids warnings generated when a GtkDialog is used without a
parent window. Also adds fixes for #220 using a solution provided
by agnivade.
2017-07-30 20:21:52 -07:00
Jon Lund Steffensen d84e7b1b3f statusicon: Only add autostart control when supported 2017-07-30 20:21:52 -07:00
Jon Lund Steffensen 7e9886cd68 controller: Emit signal when stopped 2017-07-30 20:21:52 -07:00
Jon Lund Steffensen f3a8ef54c4 utils: Make xdg module optional 2017-07-30 20:14:40 -07:00
Jon Lund Steffensen 3ea717011e Move RedshiftController to controller.py 2017-07-30 18:31:12 -07:00
Jon Lund Steffensen 4e6f2fa7ab Add Windows resources 2017-07-30 15:39:08 -07:00
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