A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu

Using Openlux to help your sleep and/or relax your eyes

If you are familiar with research suggesting that blue light affects your sleep, you might also be familiar with a (free!) software named f.lux. I use it on my iDevices (used to use it on my computers too), and it works great …. except for a few issues.

The first is CPU consumption. Seriously, this software takes up a lot of CPU. That was the main reason behind ditching xflux (the X11 edition of the software). It also doesn’t entirely block out blue light, even at the lowest color temperature it allows (this is true for the iOS version too). There were a number of other issues that became annoying over time (forced very long animations, a daemon that rarely ever works as intended, sometimes the software doesn’t even work at all, mouse cursor being left entirely out of the picture, etc.). These would (probably) all be simple to fix …. however, it’s free as in price, not as in freedom. The software is closed-source.

Openlux is a very simple open-source MIT-licensed clone I wrote that tries to address these issues (minus the mouse cursor issue, that one is a bit more complex). For now, it doesn’t contain as many features as xflux does, but it is only a first release. Animations and the lot will come later :)

I haven’t worked on packaging yet (if anyone wishes to spend some time doing this, that would be greatly appreciated!!), but for now, visit for download and compilation information (sorry for the mess in main.c, I will get to that later!).

Here are a few usage examples

openlux                      # Sets the screen color temperature to 3400K (the default)
openlux -k 1000              # Sets the color temperature to 1000K
openlux -k 2000 -b 0         # Sets color temperature to 2000K, but removes all blue light
openlux -k 2000 -b 255       # Ditto, but blue is set to 255 (maximum value, gives the screen a magenta-ish tone)
openlux -r 130 -g 150 -b 100 # Gives the screen a dark swamp green tint (Kelvin value is ignored)
openlux -k 40000             # Sets the screen color temperature to 40000K
openlux -i                   # Resets the screen color temperature

I personally like using openlux -k 10000 during the day (very relaxing for the eyes!), and openlux -k 2300 -b 40 during the night.

I hope this can be useful for you!! If you have any issues, suggestions, feedback, etc. (even if you just want to say thank-you — those are always appreciated ^^), feel free to write a comment or send me an email!


20 responses to “Using Openlux to help your sleep and/or relax your eyes

  1. jmaspons August 23, 2015 at 9:19 am

    do you know redshift? it’s a good alternative

    • Anonymous Meerkat August 23, 2015 at 6:00 pm

      thanks for letting me know!! no, I haven’t heard of it until now — looks like as if I should have done a bit more research before working on this :P

      I will still continue to work on this project though, since there are a few differences between this project and the other that I don’t wish to lose (namely, this one isn’t daemonized, and color temperatures are calculated on the fly, allowing for greater flexibility — at the cost of preciseness and speed).

  2. Bernhard S. August 23, 2015 at 9:23 am

    Thank you very much. Build was easy. Works great!

    • Anonymous Meerkat August 23, 2015 at 6:01 pm

      you’re welcome, glad it works for you!!

      • Bernhard S. September 11, 2015 at 12:20 pm

        Today I tried v.02 and the make failed. ‘XOpenDisplay’ and other links were not found. I installed a lot dev-files, but no success. Any hint for me?

        • Anonymous Meerkat September 11, 2015 at 7:43 pm

          Could you share the CMakeCache.txt file? I’m not quite sure what the issue is, but I think that the CMakeCache might have a hint as to where it relies (it contains the variables that CMake generated, such as if it found X11, where it found it, what libraries it links to, etc.)

          • Bernhard S. September 13, 2015 at 3:49 pm

            How do I share a file? My inspection shows me, that both USE_IOS and USE_X11 are BOOL:ON.
            The ‘cmake ..’ looks fine, but the ‘make’ gaves me some undefined references.

          • Bernhard S. September 13, 2015 at 3:57 pm

            Ah, the user Tankypon has the same issues. I saw it in this moment :-) And yes, I did a ‘git pull’.

            • Anonymous Meerkat September 13, 2015 at 9:33 pm

              Could you try again? I just posted a new commit. If this doesn’t work, I think I know what the issue is.

              • Bernhard S. September 14, 2015 at 6:59 am

                Hi, I posted screenshots to your github-site.

  3. alexanderbrowne August 23, 2015 at 3:32 pm

    Have you heard of redshift (, )? It’s GPL and supports Linux/X11, Windows and OS X.

    • alexanderbrowne August 23, 2015 at 3:33 pm

      (Links disappeared – because I put them in angle brackets?)

    • Anonymous Meerkat August 23, 2015 at 6:01 pm

      thanks for letting me know!! I replied to another comment about this here: (linking to avoid redundancy :) )

  4. Pingback: OpenLux programa abierto que reduce el impacto de la luz de dispositivos electrónicos en nuestra vista

  5. Pingback: Openlux 0.2 beta – Animations, iOS port | lkubuntu

  6. Pingback: Why Openlux instead of Redshift? | lkubuntu

  7. Charles September 16, 2015 at 11:54 pm

    Since you use commandline arguments for altering the light values, you can also use crontab to make the changes at certain times, certain days and for daylight savings, if you have it, you can set different entries for different months. This reduce the cpu usage.

    • Anonymous Meerkat September 17, 2015 at 12:33 am

      That was one of the ideas behind this, was to be able to use this with cron (or other) :D In order to not have it jar out of nowhere, you can also have a variable animation time (with a delay between “frames”, to lower CPU usage) :)

  8. Pingback: Fun obfuscation in openlux | lkubuntu

  9. Pingback: openlux 0.2.1 + roadmap | lkubuntu

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: