In brief: This tutorial shows you how to download and install f.lux in Ubuntu to use the Night Shift or Night Light feature in Linux.
What’s Night Shift?
Night Shift is one of the most talked about feature in iOS 9.3. It is a display-based setting that cuts down on blue light exposure at night and provides a warm yellow light that’s easier on your eyes and your circadian rhythm.
Studies have shown that the blue light in evening hours are difficult on the eyes and eventually leads to sleep deprivation. You might not even realize but it is very much possible that you are getting less sleep if you work late night on computer or smartphone screen.
The Night Shift (also called Night Light) feature adapts the display settings based on your location and the time of the day. This way, your screen’s display doesn’t remain the same round the clock and the changed display is easier on the eyes when you are using it at night.

The above picture is taken from GeekFence.
Night Shift is not unique to Apple or iOS
This Night Shift feature might be new in iOS 9.3 but it is not entirely a new concept. Android has Twilight and other similar apps for several years now. f.lux provides the same features on Linux and Mac OS X.
In fact, even Apple Store had f.lux but they removed it before launching Night Shift in iOS 9.3 and f.lux clearly was not happy about it. But that’s the dictatorial approach of Apple. It just cuts off the competition in meanest way possible.
Good thing is that f.lux is still here for Linux and we can utilize it to save our eyes and sleep while working on desktop Linux.
1. Use Redshift to get Night Light in Linux
Redshift is a simple app that provides the night light feature on Linux systems.
Plus point of using Redshift is that you just need to install it. No configuration is needed here. It automatically determines your location and sets up nightshift at sunset.
The only negative point of Redshift is that you cannot configure it to set its saturation level.
Redshift is available in Ubuntu repository. Just use the command below to install it:
sudo apt-get install redshift-gtk
To remove Reshift, use the command below:
sudo apt-get remove redshift-gtk
2. Use f.lux for night light feature in Linux
If you are using Ubuntu or any other Linux distribution based on Ubuntu such as Linux Mint, elementary OS, Linux Lite etc, you are in luck. There is GUI based indicator applet that you can use and configure f.lux easily. You can use this unofficial but reliable PPA to install f.lux applet indicator.
Open a terminal and use the following commands:
sudo add-apt-repository ppa:nathan-renniewaldock/flux
sudo apt-get update
sudo apt-get install fluxgui
For other Linux distros, get the source code of f.lux from the GitHub repository:
f.lux Indicator Applet Source Code
How to configure f.lux
Using f.lux is really easy. Once installed, open f.lux. If you are using Ubuntu Unity, you can search for it in the Dash:
When you start f.lux, you’ll see a window like the one below. You need to enter the latitude and longitude of your present location. Don’t worry if you do not know that. You are not supposed to know that by heart anyways.
Just click on the Find your latitude and longitude link and it will open web browser window. Allow location tracking, if it asks for that.
If you are in the US, you can use your zip code as well.
You’ll get the longitude and latitude data in the web browser. Copy it:
When you have the geographical data, enter it in the Preference window. Also, check the auto start part so that you won’t have to manually start it each time after you boot in to Linux.
There are various settings for the color temperature. In my opinion, Halogen is sufficient but you can preview other temperature settings as well and see what rocks your boat.
As an indicator applet, f.lux configuration is always accessible from the top panel in Unity. If you want to get the normal display, you can simply pause f.lux. Similarly, you can change the preference whenever you want.
I wanted to put a screenshot of my Ubuntu desktop with f.lux Night Shift feature activated. But for some reasons, whenever I took a screenshot, the effects somehow disappeared after saving the screenshots.
For this reason, I am using a screenshot by our friends at FossBytes. The image is of f.lux on Windows, but it gives you an idea of how it would look on a computer screen:
How to remove f.lux
If you did not like it, use the commands below to remove f.lux from your system:
sudo apt-get remove fluxgui
sudo add-apt-repository -r ppa:nathan-renniewaldock/flux
How cool is it on your eyes?
I am using Night Shift on my iPhone and f.lux on my Ubuntu 16.04. I say it does help in reducing strain on the eyes. so I feel. I am going to include it in the list of productivity tools for Linux.
In addition to this, you can also use SafeEyes that helps you avoid computer eye strain.
How about you? Have you tried using f.lux? Does it help to cool your eyes and sleep better?
Once you run redshift and set to auto start you can find redshift in your Startup Applications and change the command to something like:
redshift -t 6500:4500 -b 0.5 -l 0:51.28
-t DAY:NIGHT Range is 1000 (warm) to 25000 (cool)
-b Brightness range 0.1 to 1.0
-l LAT:LON Optional in case the auto location provider doesn’t work for you
For on demand (works regardless of location):
redshift -P -O 4500 -b 0.5
-P Resets any existing temp changes before applying a new one
-O Sets a one time temp
-b Brightness range 0.1 to 1.0
Reset all changes:
redshift -x
Nice. Thanks.
when i try f.lux the first step
this is didn’t work, and appear
“This ppa does not support focal”
please help
The PPA is indeed not available for 20.04. Use Redshift instead. It’s included in 20.04. Works pretty much the same.
Is there a way to use flux manually, without using location coordinates?
I am not aware of that.
Excelente pagina, nuevo seguidor
stopped working on ubuntu 20