I recommend f.lux too. The only problems I've encountered with it are:
- doesn't take into account wacky sun hours in nordic countries during winter, I get around this by setting my location to be somewhere else
- isn't able to automatically detect when I'm playing a fullscreen videogame, when I would prefer it automatically switch off