Improve your sleep by using Redshift on Fedora

The blue light emitted by most electronic devices, is known for having a negative impact on our sleep. We could simply quit using each of our electronic devices after dark, as an attempt to improve our sleep. However, since that is not really convenient for most of us, a better way is to adjusts the color temperature of your screen according to your surroundings. One of the most popular ways to achieve this is with the Redshift utility. Jon Lund Steffensen , the creator of Redshift, describes his program in the following way:

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.

The Redshift utility only works in the X11 session on Fedora Workstation. So if you’re using Fedora 24, Redshift will work with the default login session. However, on Fedora 25, the default session at login is Wayland, so you will have to use the GNOME shell extension instead. Note, too that the GNOME Shell extension also works with X11 sessions.

Redshift utility

Installation

Redshift is in the Fedora’s repos, and thus, all we have to do to install is run this command:

sudo dnf install redshift

The package also provides a GUI. To use this, install

redshift-gtk

instead. Remember, though, that the utility only works on X11 sessions.

Using the Redshift utility

Run the utility from the command line with a command like the following:

redshift -l 23.6980:133.8807 -t 5600:3400

In the above command, the -l 23.6980:133.8807 means we are informing Redshift that our current location is 23.6980° S, 133.8807° E. The -t 5600:3400 declares that during the day you want a colour temperature of 5600, and 3400 at night.

The temperature is proportional to the amount of blue light emitted: a lower temperature, implies a lower amount of blue light.  I prefer to use 5600K (6500K is neutral daylight) during the day, and 3400K at night (anything lower makes me feel like I’m staring at a tomato), but feel free to experiment with it.

If you don’t specify a location, Redshift attempts to use the Geoclue method in order to determine your location coordinates. If this method doesn’t work, you could use multiple websites and online maps to find the coordinates.

screenshot1

Don’t forget to set Redshift as an autostart command, and to check Jon’s website for more information.

Redshift GNOME Shell extension

The utility does not work when running the Wayland display server (which is standard in Fedora 25). Fortunately, there is a handy GNOME Shell extension that will do the same job. To install, run the the following commands

:
sudo dnf copr enable mystro256/gnome-redshift
sudo dnf install gnome-shell-extension-redshift

After installing from the COPR repo, log out and log back in of your Fedora Workstation, then enable it in the GNOME Tweak tool. For more information, check the gnome-redshift copr repo, or the github repo.

After enabling the extension, a little sun (or moon) icon appears in the top right of your GNOME shell. The extension also provides a settings dialog to tweak the times of the redshift and the temperature.

screenshot-from-2017-01-18-15-21-47

 

Relative software

F.lux

Redshift could be seen as the open-source variant of F.lux. There is a linux version of F.lux now. You could consider using it if you don’t mind using closed-source software, or if Redshift doesn’t work properly.

Twilight for Android

Twilight is similar to Redshift, but for Android. It makes reading on your smartphone or tablet late at night more comfortable.

Redshift plasmoid

This is the Redshift GUI version for KDE. You can find more information on github.

 

 

 

 

 

 

 

 

 

Save

Save

Save

Save

Save

Save

Using Software

22 Comments

  1. Osqui

    GNOME Shell extension should be on official repository. This piece of software is a must!

  2. Diving Deer

    For Android there is also Red Moon, https://github.com/raatmarien/red-moon
    Unlike Twilight it is open source.

    • Be

      Thanks for mentioning this. For Android, there is also Yet Another Auto Brightness (YAAB) which automatically adjusts screen brightness to correspond with the amount of light its camera senses. YAAB and Red Moon can be used together by setting “Dim level” to 0% and turning off “Lower brightness” in Red Moon’s settings.

  3. Dan

    Open source alternative to Twilight for Android:
    Red Moon
    https://f-droid.org/repository/browse/?fdfilter=moon&fdid=com.jmstudios.redmoon

  4. You can use Redshift with Wayland too, but it takes some work for the time being.

  5. Aaron Lu

    Nice. I’ve been using xflux but it stopped working after xorg server updated to 1.19.1. It’s good to know this software and it works for me.

  6. kapoath

    Thank you for the detailed instructions to add Redshift as a Gnome shell extension under Wayland. I needed that!

    Works like a charm!

  7. Ed

    I’m also using Redshift on Fedora 24, with no problem. The only gripe I have is that this requieres a internet conenction to work/activate. Without Geoclue it’s helpless.
    While back when I was using flux on Ubuntu, once setup,it would work properly even with NO INTERNET .
    Making this internet-dependant makes it less practical for people who use computers offline .

    • kapoath

      I thought that Flatpak could/would solve such issues. For example apps based on specific distro, like f.lux and PacketTracer 7.0 from Cisco that are compatible with Ubuntu, could work in Fedora with the use of Flatpak.

      But it doesn’t seem that to be the case.

    • cazo

      Ed: Setting the provider to ‘manual’ & entering your latitude/longitude allow you to use redshift offline (you can put those values into ~/.config/redshift.conf like:

      [redshift]
      location-provider=manual
      [manual]
      lat=55.7
      lon=12.6

  8. Striker

    Just FYI: This is not limited to “Fedora Workstation” which is simply just Fedora with Gnome. The article should reflect that this also works on Fedora 25 Plasma 5 default install, which uses X11.

  9. lupinix

    For KDE Plasma the linked plasmoid is outdated… We have an applet for Plasma in official repository: https://apps.fedoraproject.org/packages/plasma-applet-redshift-control

    So just dnf install plasma-applet-redshift-control and add it to your panel 😉

  10. mystro256

    I wonder how many people are using my copr. I just popped it on there for personal use and before you know it, I see blog posts popping up.

    Note that the GNOME extension works for both Wayland and XOrg, so if you still use X and f.lux or redshift gives you issues, you can always give the extension a shot. For example, I used to use redshift but I found it would flicker a lot.

  11. murpholinox

    Thanks!!

  12. Magnus H

    Wayland solution worked out of the box, thanks! But I would like to have more general brightness adjustment, not just along this physical color scale. Or at least have a 2-dimensional color and intensity scale.

    Many screens have LED backlights with very limited brightness adjust possibilities. One can use dark themes, but that always creates some mess somewhere when you want to use an older application that doesn’t adapt properly or when you do remote desktop/VNC, etc, a generic way of getting it everywhere would be much better.

    I have been trying earlier to go through the gnome accessibility settings to adjust brightness on the screen from SW but that did not work for me (bug filed). I suppose you could go through the color profile stuff to hack it in but that’s a bit painful and kind of backwards.

  13. Steve

    Or you could just turn off your devices and leave them in another room (than your bedroom) when going to sleep.

  14. Hans Anderson

    Nice idea of promoting something like Redshift but unfortunately useless. Under a default configuration, it simply wouldn’t work with the most recent Fedora release.

    Recommending third-party repositories for Fedora seem not cool either…

    • Mystro256

      In my defence, I am a fedora dev, but the copr is ultimately a hacky interim solution until someone can come along and properly implement it in GNOME.

Comments are Closed

The opinions expressed on this website are those of each author, not of the author's employer or of Red Hat. Fedora Magazine aspires to publish all content under a Creative Commons license but may not be able to do so in all cases. You are responsible for ensuring that you have the necessary permission to reuse any work on this site. The Fedora logo is a trademark of Red Hat, Inc. Terms and Conditions