Redshift 1.7

I finally had some time to throw a new release of Redshift together. The most important change, for most of you, is probably the Geoclue location provider by Mathieu Trudel-Lapierre. The old GNOME clock location provider has stopped working for many, as Ubuntu no longer includes a clock applet in the unity desktop. This is fixed now with this new location provider, which should work right out-of-the-box on Ubuntu Natty systems.

Other news are:

  • Allow brightness to be adjusted (-b).
  • Provide option to set color temperature directly (Joe Hillenbrand).
  • Add option to show program version (-V).
  • Add configure.ac option to install ubuntu icons. They will no longer be installed by default (Francesco Marella).
  • config: Look in %userprofile%/.config/redshift.conf on windows platform.
  • Fix: w32gdi: Obtain a new DC handle on every adjustment. This fixes a bug where redshift stops updating the screen.

Redshift 1.6 released

Finally, a new release of Redshift, and at the same time packages have been built for the newly released Ubuntu Maverick (to be found in the PPA as usual). There is a bunch of bug fixes in this release and some hastily thrown-together configuration file support. It works, but there is no documentation other than the example at the end of this post. Here is the list of changes:
  • Support for optional configuration file (fixes #590722).
  • Add man page for redshift written by Andrew Starr-Bochicchio (fixes #582196).
  • Explain in help output that 6500K is the neutral color temperature (fixes #627113).
  • Fix: Handle multiple instances of the GNOME clock applet; contributed by Francesco Marella (fixes #610860).
  • Fix: Redshift crashes when VidMode fails (fixes #657451).
  • Fix: Toggle menu item should not be of class gtk.ImageMenuItem (fixes #620355).
  • New translations and translation updates: Lithuanian (Aurimas Fišeras); Brazilian Portuguese (Matteus Sthefano Leite da Silva); Finnish (Jani Välimaa); Italian (Simone Sandri); French (Emilien Klein); Russian (Anton Chernyshov).

Looking forward to 1.6.1

I hope to release Redshift 1.6.1 before the end of the month. It will include some small bug fixes, updated documentation and updated translations, but for this to happen I will need your help:

  • Please help get the translations finished for 1.6.1 if you are fluent in one of the languages that Redshift has been translated to. The text strings will not change before 1.6.1.
  • Are you familiar with writing man pages? Please help document the configuration file syntax (#662632).

Configuration file

Redshift will look for a configuration file in “~/.config/redshift.conf” (or in XDG_CONFIG_HOME if that has been set). A different configuration file can be loaded with the command line option “-c”. Here is an example:

; Global settings
[redshift]
temp-day=5700
temp-night=3500
transition=1
gamma=0.8:0.7:0.8
location-provider=manual
adjustment-method=vidmode

; The location provider and adjustment method settings
; are in their own sections.
[manual]
lat=55.0
lon=12.0

; In this example screen 1 is adjusted by vidmode. Note
; that the numbering starts from 0, so this is actually
; the second screen.
[vidmode]
screen=1

Windows gamma adjustments

When porting Redshift to Windows I ran into trouble when setting a color temperature lower than about 4500K. The problem is that Windows sets limitations on what kinds of gamma adjustments can be made, probably as a means of protecting the user against evil programs that invert the colors, blank the display, or play some other annoying trick with the gamma ramps. This kind of limitation is perhaps understandable, but the problem is the complete lack of documentation of this feature (SetDeviceGammaRamp on MSDN). A program that tries to set a gamma ramp that is not allowed will simply fail with a generic error leaving the programmer wondering what went wrong.

There are workarounds, but you will not find them anywhere unless you have the patience to work your way through assembly listings of Windows DLLs. So here they are, for your convenience; these two tricks will work at least on a Windows 7 machine:

  • Go to the registry database and create the key “GdiIcmGammaRange” (that’s a capital I in Icm as in Image Color Management) under “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ICM”. The type must be DWORD. The value determines the amount of adjustment that can be made, where 0 means no adjustments possible at all, and 256 means any adjustment is allowed. You’ll find a REG-file below that sets it to 256.
  • Run your program from the Local System account.

The registry key should be set as shown in this screen shot.

So if you want to run the experimental build of Redshift on Windows, you need to use one of the above methods if you want to use the same color temperatures as are available on the linux version.

Update: Here’s a REG-file that will set the appropriate key in the registry: RemoveGammaLimitation.reg. Save it with a “.reg” extension and double click to apply.

Redshift 1.5 released

I had wanted to release redshift 1.5 last month but for various reasons I never got around to it. Today I received a very generous donation which reminded me that I really needed to get this release out.  The source is available from the launchpad project page as usual. Packages for Ubuntu Lucid are available in the PPA. The contributors for this release are: Francesco Marella, Gabriel de Perthuis, aleth and the translators.

  • Application launcher and autostart feature contributed by Francesco Marella (fixes #590550, #612710).
  • Improve GNOME location provider (patch by Gabriel de Perthuis) (fixes #598277).
  • New ubuntu-mono-dark icons that fit the color guidelines better. Contributed by aleth (semi-fixes #596536).
  • Improve error message when first adjustment method fails (fixes #596537).
  • Translation updates: Basque (Ibai Oihanguren); Chinese (Jonathan Lumb);
    French (Hangman, XioNoX); German (Jan-Christoph Borchardt); Hebrew
    (dotancohen); Spanish (Fernando Ossandon)

Thank you contributors and donators! (btw, the donation will be spent on hosting for this website).

Redshift 1.4 released

I’ve released redshift 1.4 today. The source is available from the launchpad project page as usual. Packages for Ubuntu Lucid are available in the PPA. There’s lots of exiting new stuff in this release thanks to several contributors: Francesco Marella, Dan Helfman and all the translators.

  • Command line options for color adjustment methods changed. Procedure for setting specific screen (-s) or CRTC (-c) changed. See redshift -h for more information.
  • Automatically obtain the location from the GNOME Clock applet if possible.
  • Add application indicator GUI (by Francesco Marella) (fixes #588086).
  • Add reset option (-x) that removes any color adjustment applied. Based on patch by Dan Helfman (fixes #590777).
  • configure options for GUI changed; see configure --help for more information.
  • New translations: German (Jan-Christoph Borchardt), Italian (Andrea Amoroso), Czech (clever_fox), Spanish (Fernando Ossandon), Finnish (Ilari Oras).

UPDATE: 1.4.1 released. It includes mono icons for Ubuntu (by Joern Konopka); the status icon toggles to show whether Redshift is on or off; and it has updated translations: Spanish (Fernando Ossandon), Russian (Чистый).

f.lux for Linux

I have been using f.lux for some time now and it is a really nice tool. It adjusts the color temperature of the screen at night to a more reddish tone which greatly reduces the strain on the eyes. It takes a while to get used to the red tint but now there is no going back.

When I learned that there is a version for linux (xflux) I had to get that for my Ubuntu laptop. I was quite disappointed, however, when I discovered that not only does it not feature a sleek GUI like the windows version, it also simply does not work at all on my laptop. f.lux throws this message at me: “Sorry, we only support 24/32-bit displays right now” which must be a bug because I am running in 24-bit mode with the open source radeon driver.

Other features that are present in the windows version seem to be missing as well in xflux, like setting the daytime temperature. Ultimately I decided to code my own tool to adjust the color temperature. The result is an open source program called Redshift.

Please post comments here.