Redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night. This program is inspired by f.lux (please see this post for the reason why I started this project).

Download

Latest release is Redshift 1.9 published on 2014-04-06. Packages are available from most distributions. In addition the following downloads are available:

Project page

The project is managed at Github where issues and pull requests can also be posted. Please don’t use the old bug tracker at the launchpad project page anymore. Updates to the translations can still be contributed through the launchpad translations page.

Project description

Redshift adjusts the color temperature according to the position of the sun. A different color temperature is set during night and daytime. During twilight and early morning, the color temperature transitions smoothly from night to daytime temperature to allow your eyes to slowly adapt. At night the color temperature should be set to match the lamps in your room. This is typically a low temperature at around 3000K-4000K (default is 3700K). During the day, the color temperature should match the light from outside, typically around 5500K-6500K (default is 5500K). The light has a higher temperature on an overcast day.

Redshift running in one-shot mode
Redshift running in one-shot mode (right half shows a preview of the redness effect)

Technical details

On linux and similar systems the color temperature is set with an X server extension. On the windows platform it is set using GDI. The color temperature is changed by setting appropriate gamma ramps. If you have configured your own gamma ramps they will be overwritten but in that case you probably care too much about color accuracy to use this program anyway. Your graphics driver and X server needs to either support at least RANDR version 1.3 or the VidMode extension. Redshift can also be applied to the Linux console by explicitly selecting the DRM driver.

Redshift assumes that your screen will produce light at a color of 6500K when no color correction is applied by the program. Thus, 6500K is the neutral temperature. Setting the color temperature to a value higher than this results in more blue light, and setting a lower value will result in more red light.

Configuration options

Redshift will continously update the color temperature at regular intervals. One shot mode can be selected if you only want to do one adjustment. The color adjustments done by Redshift can be temporarily toggled on and off by sending it the USR1 signal:

 $ pkill -USR1 redshift

The command line options are explained by running redshift -h. All options have reasonable defaults. You’ll need to specify your current location only if redshift can’t obtain the location from an automatic location provider. All color adjustment methods will be tried until one that works is found unless you explicitly select one. The same applies to location providers.

Beware that the location providers are not perfect. The geoclue method provides a location through the Geoclue framework, which may or may not work out-of-the-box. If it doesn’t work check that your Geoclue installation is properly configured. The position from Geoclue will currently not be updated regularly while Redshift is running but this is planned for a future release.

Example (location is Copenhagen, Denmark):

 $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m vidmode -v

Configuration file

A configuration file can be created, but the documentation is a bit sparse. You’ll have to create it manually and put it in ~/.config/redshift.conf. The following is an example of a configuration file (thanks to kenden):

; Global settings for redshift
[redshift]
; Set the day and night screen temperatures
temp-day=5700
temp-night=3500

; Enable/Disable a smooth transition between day and night
; 0 will cause a direct change from day to night screen temperature. 
; 1 will gradually increase or decrease the screen temperature
transition=1

; Set the screen brightness. Default is 1.0
;brightness=0.9
; It is also possible to use different settings for day and night since version 1.8.
;brightness-day=0.7
;brightness-night=0.4
; Set the screen gamma (for all colors, or each color channel individually)
gamma=0.8
;gamma=0.8:0.7:0.8

; Set the location-provider: 'geoclue', 'gnome-clock', 'manual'
; type 'redshift -l list' to see possible values
; The location provider settings are in a different section.
location-provider=manual

; Set the adjustment-method: 'randr', 'vidmode'
; type 'redshift -m list' to see all possible values
; 'randr' is the preferred method, 'vidmode' is an older API
; but works in some cases when 'randr' does not.
; The adjustment method settings are in a different section.
adjustment-method=randr

; Configuration of the location-provider:
; type 'redshift -l PROVIDER:help' to see the settings
; ex: 'redshift -l manual:help'
[manual]
lat=48.1
lon=11.6

; Configuration of the adjustment-method
; type 'redshift -m METHOD:help' to see the settings
; ex: 'redshift -m randr:help'
; In this example, randr is configured to adjust screen 1. 
; Note that the numbering starts from 0, so this is actually the second screen.
[randr]
screen=1

Status icon

Start the program redshift-gtk instead of redshift, with the same arguments as you would pass to redshift. This will create an icon for Redshift in the system tray. The icon will allow you to toggle Redshift on and off. Thanks goes to the Tango Desktop Project for the icon. redshift-gtk requires at least Python 3.2 (since Redshift 1.9).

Note: Before version 1.8 redshift-gtk was known as gtk-redshift.

Redshift status icon
Redshift status icon

Related software

  • Redshift Plasmoid for KDE provides a graphical configuration interface for Redshift.
  • Twilight for Android provides a similar application for Android (not open source).
  • f.lux is a similar program for Windows/Mac and iPhone/iPad, and there is also a Linux version (not open source).

Known bugs and limitations

  • Redshift won’t affect the color of your cursor when your graphics driver is configured to use hardware cursors. Some graphics drivers have an option to disable hardware cursors in xorg.conf.
  • Certain video drivers do not support adjustable gamma ramps. In some cases Redshift will fail with an error message, but other drivers silently ignore adjustments to the gamma ramp.
  • Redshift has a brightness adjustment setting, but it does not work the way most people might expect. In fact it is a kind of fake brightness adjustment obtained by manipulating the gamma ramps, which means that it does not reduce the backlight of the screen.

Comments, suggestions, patches or donations will be greatly appreciated.

  • Max

    I’m living in south-western Germany and I start Redshift with:
    gtk-redshift -l 48.0:7.9 -t6400:4000 -m vidmode
    I checked, the coordinates are pretty accurate. Still, it won’t detect day/nighttime alright. It’s 11:34 am right now and redshift says it’s nighttime… What’s wrong?

  • annie

    I’m running Ubuntu 11.04 on a 64-bit laptop and downloaded the Redshift package through Ubuntu’s Synaptic Manager, including the GTK package that seemed to go with it. And there it sits. Nothing happens. There is no GUI, no icon tray, nothing…and my screen at night is just as bright as ever. :-) I’m new at all of this. Just wondering if there’s something I’m missing? I appreciate any help you may be able to give.

    Thank you!
    Annie

  • annie

    I was able to figure it out…What an awesome program! Thanks so much for developing this.

    Annie

  • Carl

    Hey!

    1) Great app, been using it for a while and can’t live without it
    2) Unfortunately I can no longer set the location (Odense, Denmark (DK for fanden)). I get the error: chr@storbudde:~$ gtk-redshift -l 55.24:10.23
    Too many arguments.
    Failed to set manual option.
    Try `-l manual:help' for more information.

    Any suggestion?

  • RPUBrooklyn

    Wow! Just downloaded and installed tonight for Ubuntu Natty 11.04.
    I dislike all white light at night and this is perfect for that very reason.
    One very nice application!

    Thanks.

  • benjo

    I’ve got a strange problem in France :
    $ redshift
    No city selected as current city.
    Initialisation de gnome-clock echouée.
    Trying next provider...
    Latitude and longitude must be set.

    –> It works when I put my location, but the terminal doesn’t stop when it’s done… and I have to do it at every boot, even if I choose to start it automatically with gtk-redshift.
    example : $ redshift -l 47.2:-1.6
    Using method `randr'.

    (and it stays like this, I can’t close the terminal)

    Any Idea ?

  • Jon Lund Steffensen

    Thanks for all your comment. I’m really sorry that I haven’t had time to respond to individual comments for a while.

    @Carl: Hi Carl, I don’t know why that doesn’t work. Perhaps this will work: gtk-redshift -l manual:lat=55.24:lon=10.23.

  • Wolfgang Corcoran-Mathe

    Thanks so much for creating this great tool!

  • John Smith

    This is a great program, but it desperately needs documentation.

  • http://brettalton.com Brett Alton

    Is it possible to get the PPA updated to Ubuntu 11.04 Natty?

    ppa:jonls/redshift-ppa

  • FOSSFTW

    Can it go any lower/darker than 3000K? If not, then why?

    Thanks again for the great tool Jonls.

  • Denis

    Thanks, Jon.
    Great application. Gentoo build works perfectly.

  • Scott

    Likewise, another request for an Ubuntu Natty compatible build.

  • Scott

    Here’s an easy fix for Natty.

    1. Install as usual.
    2. Press the super button and type menu and press enter.
    3. In the left pane, click “accessories.”
    4. In the right pane, click on Redshift and click on properties.
    5. Open up a web browser and go to: http://stereopsis.com/flux/map.html
    6. Put in your location and press enter.
    7. For the numbers that appear below, delete the comma and the space. Between the numbers put a colon. Like this :
    8. Highlight the numbers with the colon between them and press ctrl+c
    7. Back in the Launcher Properties window under the command field, replace what’s there with this: gtk-redshift -l
    8. Note that above where it says , you press ctrl+v to insert the number from the web browser to that your proper location is inserted into redshift.
    9. You’re done! Redshift will work the same as before! If it doesn’t launch automatically you can always just press super+s and type redshift.

    10. If it’s not loading on startup for some reason, get back to the command field you had up a minute ago and copy the whole field.
    11. Press the super button and type startup.
    12. In the screen that appears press the “add” button. Under name type Redshift and under command press and the launch command from your menu, complete with latitude and longitude, should appear.
    13. Press Add, hit close, and enjoy redshift on startup automatically.

    I hope this helps!

  • Scott

    Unfortunately I didn’t realize some of my text would be mistaken for code! Here’s a quick addendum to fix the missing bits:

    – The end of 7 should read gtk-redshift -l ctrl+v
    – 8 should read Note that above where it says ctrl+v, you…
    – The middle of 13 should read Under name type Redshift and under command press ctrl+v and…

    Ah, that makes more sense!

  • Pingback: Less Eyestrain – Auto Monitor Color Adjustment Based on Location » » Bob Tech Bob Tech()

  • http://morphix.servhome.org Morphix

    This is an amazing software ! I’m using it on Windows 7 x64 and Fedora 13 for a moment and that’s really helpful.

    On Windows, i made a little batch script with my configuration. It opens a command prompt window at launch, change the color and close the command prompt.

    On Fedora, i did the same with a bash alias. In order to answer to Benjo, add & at the end of the command to run the process background and use the terminal for what you want.

    You sir are a genius, i don’t know why redshift is still not included in OSes.

  • http://wundernews.com josef wunder

    i traditionally simply turn my brightness down as low as possible during the wee hours. redshift adds a whole new dimension of visual relaxation. good play chap. good play indeed.

  • Pingback: Die Welt ist gar nicht so. » Linkschleuder (18)()

  • catch22

    Using Crunchbang-Statler (Debian/Openbox) in terminal
    “gtk-redshift -l 51.13:04.25″
    works, but I don’t know how to keep the redshift icon permanent. If I close the terminal the icon goes too. Great tool btw!

  • Pingback: Redshift: épargner ses yeux devant l’écran | Ludovic Favre DevBlog()

  • Pingback: RedshiftGUI - dereenigne.org()

  • Ramesh

    A zillion Thank You to you my friend. I won’t be hurting my eyes anymore and I can’t THANK YOU enough for that. If someway Ubuntu can make it a part of the standard distribution it will help many more eyes. Great work.

    regards
    Ramesh

  • Juho

    Thank you for this! Great application.

  • STEELBAS

    Just wanted to say thanks for this great program :)

  • Tiago

    How can I determine the optimal values ​​for the following settings:
    -g R:G:B

    and,

    -t DAY:NIGHT

    ?
    Graciously,
    Tiago Alisson

  • Pingback: Redshift 1.7 | jonls devblog()

  • http://www.talkingrobot.org Martin Sondergaard.

    Am I right in thinking that the gtk-redshift version only works for distros that use Gnome? You might mention this in the website, its not obvious to everyone.

    I’m using Fedora with KDE, not Gnome. So the gtk version doesn’t work for me, but I found that the command-line version of Redshift works fine. Its in the Fedora software repository, so I installed it from there, using KPackageKit.

    Like Annie, above, I didn’t know how to start it up at first. You can start it from the linux command prompt, “$”, with “redshift -h”. The “-h” makes it show Help.
    $ redshift -h

    To make it change the color temperature using day and night times suitable for my location, London, I used this command:
    $ redshift -l 51.5001524:0.1262362
    Its easy when you know how. But not until then.

  • http://www.talkingrobot.org Martin Sondergaard.

    I found a bug. This command makes it start up, and will change the colour temperature to red, without taking into account that it is now daylight. It is 4:33 pm here in London.
    $ redshift -l 51.5001524:0.1262362

    I’m using Fedora Linux, with KDE.

  • http://baach.de Joerg Baach

    Oh this is so good I could cry. I just got the lcd panel on my t400 replaced, and got a cold blue samsung one instead of the slightly warmer lg before. Had the same issue 2 years ago, and couldn’t do anything. Now its only one little command line setting. Fantastic! Thanks a lot

  • Mebus

    Hey!

    Very nice. I was about to write the same in Python and C as I saw that xflux isn’t completely open source.

    Anyway, there already is a package for redshift and gtk-redshift in Fedora 15:

    https://admin.fedoraproject.org/pkgdb/acls/name/redshift

    Just use

    yum install gtk-redshift redshift

    and you are done.

    Your website says

    “Fedora: Packages are being worked on.”

    Maybe you could update this.

    Thanks.

    Mebus

  • http://nateshiff.wordpress.com/ Nate Shiff

    Oh, my god. My friend, this app is so, so glorious. I use it almost every night on my laptop running Ubuntu 11.04. I tend to use the -o switch to see a dramatic effect. But, I applaud you, your effort, and your Redshift software. This shit is dank, it is da-ha-HANK, YO! <3 <3 Redshift

  • http://profiles.google.com/tom.dignan Tom Dignan

    Thank you so much. I was getting horrible migraine headaches until I got this installed. F.lux couldn’t handle my multiple monitor setup.

  • Pingback: Linksschleuder #1 | PoBlog()

  • Pingback: Utiliser Redshift pour se reposer les yeux | Scout123()

  • Pingback: Automatically adjust computer display brightness with flux | Free and Lazy()

  • marleo

    Excellent! Thank you.

  • Miscusernn

    You are the man. Very good application, keep up the good work :-)
    The only thing i miss is a options-gui. A simple window that allows you to change all values would be great!

  • Joefass

    Wow. Yah … thank you. Keep doing what you’re doing.

  • Pingback: Configuring Ubuntu 11.04 « Nate Shiff()

  • Stroud

    This is one of the best applications I’ve ever installed. However, the Ubuntu 11.04 updater returns this error:

    dpkg: error processing /var/cache/apt/archives/redshift_1.7-0ubuntu1_i386.deb (–unpack):
    trying to overwrite ‘/usr/share/pyshared/gtk_redshift/__init__.py’, which is also in package gtk-redshift 1.6-1ubuntu1
    dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)

    Any ideas?

  • http://jonls.dk/ Jon Lund Steffensen

    Make sure you either only install packages from official ubuntu or only from my ppa. They don’t mix well.

  • Stroud

    How do I do that? I tried unchecking all the other updates but still got the error.

  • http://jonls.dk/ Jon Lund Steffensen

    Try to remove gtk-redshift (with “apt-get remove gtk-redshift”) before you upgrade.

  • Stroud

    Thanks!

  • Jon Deane

    This doesn’t work for me. It never activates. Using Fedora 15 installed from the repository.

  • Anonymous

    Hey. I really like this application. I found it great. Now I simply can’t stand using my screen without it. I’ve set it up to autostart at login. When I just deactivated the program to see what the screen would look like, I just reassured myself that I have made a right choice.

    My screen’s white balance is really not so great. It gives off a strong blue-white light that I suspect would be not so great for your eyes in the dark. I recall the white balance was OK, until I started messing with settings and had to factory-reset it. For some reason, the color balance never felt right afterwards (my screen is second-hand 20″ LG off eBay).

    I don’t know if the effect of less strain on my eyes is just a placebo effect or an actual improvement, or even healthy. I suppose I cannot really determine unless I’m willing to do some extended tests with and without Redshift. Thing is, it’s not really happening since with Redshift it’s just so much better.

    I would really like to thank the developer. This program has really made a difference.

  • http://openid.aol.com/miloskomarcevic Miloš

    Console output?

    I suspect you either have to set your location manually (see docs above), or add your IP address to http://www.hostip.info/ and reboot.

  • Pingback: Linkschleuder #1 | PoBlog()

  • Pablo Montepagano

    I can’t get gtk-redshift to adjust my color temperature automatically. When it’s night, I have to click the status icon, and click it again to toggle it when it’s daytime.
    Shouldn’t it transition automatically given the time and location?

    I’m on Arch Linux x86_64