It would be extremely useful to set a parameter with custom sunrise and sunset times instead of a location.
I live in Estonia, where the sun sets in winter at around 15:00 and in summer around 22:00. I dont want my laptops screen temperature to tell my brain to start preparing for sleep at 15:00. This can be solved with a custom forced sunset time. This new parameter would override the one set with "-l"
I came here to see if a recent version of redshift had implemented this. The main developer seems to be living in Denmark, so I'm a bit surprised to see that this is not an option.
I think I have to disable redshift during the winter, as it's counterproductive to have your brain switch into sleep mode at three o'clock in the afternoon. It's a shame, because I really liked to use redshift when the sun was synched to my bedtime.
I think there might be different reasons for using redshift or maybe the problem is that people are sensitive to the redness effect in different ways. My main motivation for using redshift is that when the sun sets the lights around me change to artificial, more-reddish lighting. I want my screen to match that because otherwise I feel that my eyes are strained. For this use case redshift should clearly follow the local cycle of the sun.
I am open to patches that are useful for other use cases, like the one you describe. A possible work-around is to manually set a location that is closer to the equator.
I would also like to see this implemented, perhaps even with the possibility of multiple custom time points with associated colour temperatures. For example -C 23:00/6500/1.0 -C 04:00/5500/0.8 -C 18:00/6800/1.0, where the syntax is -C time/temperature/brightness.
I would be open for implementing it myself, except either the code must better documented or I need to get some pointers on where to the changes.
@allanlaal @ironhouzi I have written an alternative, where it is possible to this, and an example configuration file that can do that is included.
I think the path forward for Redshift will be to move to a DBus based service (I think as a Redshift 2.0 release) which will allow any external program to override the temperature/location/solar elevation in a customized manner. Please see the dbus-service branch for a development preview. In this way the core Redshift program will be kept simple and easily maintainable and any advanced features can be implemented in external programs, scripts or user interfaces.
That would probably be the way to go forward with Redshift.
Just in case someone is interested in running a "fixed" time redshift, and haven't figured out an easy way to do it on an old version of redshift (a lot of people, myself included are running 1.8 because it's in ubuntu 14.04!) set it to some location at the equator, there the sunset is always about the same time.
E.g. in Finland the following configuration results a "sunset" at 19.48-20.18 local time all year round (GMT+2/standard time, during daylight saving it's one hour more):
$ cat .config/redshift.conf
[redshift]
location-provider=manual
[manual]
lat=0.0
lon=0.0
I had a similar desire and realized I could roll my own solution using crontab:
# redshift - full spectrum at 7am and redshift at 10pm
0 7 * * * env DISPLAY=:0 redshift -O 6500
0 22 * * * env DISPLAY=:0 redshift -O 5000
Had to add the DISPLAY env to make it work, which I picked up from https://help.ubuntu.com/community/CronHowto.
Of course, this causes a jarring transition, but I could make it change gradually by adding more entries.
Also, I guess this assumes my computer will be on to execute the command at the right time... :)
Now that I think of it, I could just have a */15 minute crontask to call a script that does something based on the time.
Finally got this cron script working the way I want. If interested, see https://github.com/linusrachlis/redshift-continuous
It runs every 5 minutes, and uses Redshift to update the screen temperature based on the time. I've set it up to shift over a 1-hour period - dawn from 7-8am, and dusk from 9-10pm. It's easy to change the script though.
Not sure how portable it will be -- for all I know, the DISPLAY env var may be Ubuntu only, I don't know. (See previous post.)
The good thing is, it doesn't matter much if my computer was off for the transition time, because in <5 minutes after I wake it up, it will adjust the temp to match the time of day.
HTH!
Checking in to say there's still users interested in at least offsetting the time calculation without having to do it ourselves (as in these cron examples) or abuse the elevation-low or elevation-high parameters. A simple "time-offset" parameter that pushes the curve one way or the other would be helpful! It would be trivial for an end-user to calculate this (eg just find local sunrise or sunset time, and compute the difference between it and their typical wake/rest times).
I might take up writing a patch myself, though c/c++ are not something I'm practiced with, if this would be helpful.
Implemented in #529
Most helpful comment
I came here to see if a recent version of redshift had implemented this. The main developer seems to be living in Denmark, so I'm a bit surprised to see that this is not an option.
I think I have to disable redshift during the winter, as it's counterproductive to have your brain switch into sleep mode at three o'clock in the afternoon. It's a shame, because I really liked to use redshift when the sun was synched to my bedtime.