GithubHelp home page GithubHelp logo

openlux's Introduction

openlux

Adjusts screen color temperature, similar to f.lux, and redshift.

Primary differences from its competitors:

  • One-shot only - suited for instant temperature changes or scheduled via cron
  • Simple - no location-based automatic temperature shifting
  • iOS support (requires jailbroken iDevice)

Prerequisites

Required software:

  • CMake (>=2.6, compilation only)
  • GCC or Clang (compilation only)
  • One of these:
    • X11, with support for the Xf86VM extension (header files needed for compilation)
    • iOS >= 4

Installation

If you wish to compile for iOS, check the wiki for instructions.

Compilation:

mkdir build
cd build

cmake ..
make

The generated program will be located in build/src/openlux. If you wish to install:

sudo make install

Examples

Run openlux -h for a list of command-line options.

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
openlux -a 10800000 -d 60000 -k 2000
                             # Ramps the color temperature gradually to 2000K over 3 hours (10800000 msecs) in
                             # steps of 1 minute (60000 msecs)

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

openlux's People

Contributors

anonymousmeerkat avatar gromgit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

openlux's Issues

Can't link

I have this issue when the command 'make' tries to link the executable:

Scanning dependencies of target ol_backend_video
[  9%] Building C object src/backend/video/CMakeFiles/ol_backend_video.dir/video.c.o
[ 18%] Building C object src/backend/video/CMakeFiles/ol_backend_video.dir/x11.c.o
Linking C static library libol_backend_video.a
[ 18%] Built target ol_backend_video
Scanning dependencies of target ol_backend_gamma
[ 27%] Building C object src/backend/gamma/CMakeFiles/ol_backend_gamma.dir/absolute.c.o
[ 36%] Building C object src/backend/gamma/CMakeFiles/ol_backend_gamma.dir/relative.c.o
/home/tankypon/Nightly/openlux/src/backend/gamma/relative.c: In function ‘ol_backend_gamma_relative_rgb’:
/home/tankypon/Nightly/openlux/src/backend/gamma/relative.c:72:16: warning: variable ‘color_mod’ set but not used [-Wunused-but-set-variable]
   unsigned int color_mod;
                ^
/home/tankypon/Nightly/openlux/src/backend/gamma/relative.c:64:35: warning: unused parameter ‘gamma_ramp_size’ [-Wunused-parameter]
                               int gamma_ramp_size,
                                   ^
[ 45%] Building C object src/backend/gamma/CMakeFiles/ol_backend_gamma.dir/gamma.c.o
Linking C static library libol_backend_gamma.a
[ 45%] Built target ol_backend_gamma
Scanning dependencies of target ol_backend_os
[ 54%] Building C object src/backend/os/CMakeFiles/ol_backend_os.dir/posix.c.o
[ 63%] Building C object src/backend/os/CMakeFiles/ol_backend_os.dir/os.c.o
Linking C static library libol_backend_os.a
[ 63%] Built target ol_backend_os
Scanning dependencies of target openlux
[ 72%] Building C object src/CMakeFiles/openlux.dir/animate.c.o
[ 81%] Building C object src/CMakeFiles/openlux.dir/color.c.o
[ 90%] Building C object src/CMakeFiles/openlux.dir/kelvin.c.o
[100%] Building C object src/CMakeFiles/openlux.dir/main.c.o
/home/tankypon/Nightly/openlux/src/main.c: In function ‘main’:
/home/tankypon/Nightly/openlux/src/main.c:329:2: warning: label ‘end’ defined but not used [-Wunused-label]
  end:
  ^
/home/tankypon/Nightly/openlux/src/main.c:320:2: warning: label ‘free_gamma_backend’ defined but not used [-Wunused-label]
  free_gamma_backend:
  ^
/home/tankypon/Nightly/openlux/src/main.c:314:2: warning: label ‘free_gamma_value’ defined but not used [-Wunused-label]
  free_gamma_value:
  ^
/home/tankypon/Nightly/openlux/src/main.c:309:2: warning: label ‘free_default_gamma_value’ defined but not used [-Wunused-label]
  free_default_gamma_value:
  ^
/home/tankypon/Nightly/openlux/src/main.c:308:2: warning: label ‘start_end’ defined but not used [-Wunused-label]
  start_end:
  ^
Linking C executable openlux
backend/video/libol_backend_video.a(x11.c.o): In function `ol_backend_video_x11_init':
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:55: undefined reference to `XOpenDisplay'
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:68: undefined reference to `XF86VidModeQueryVersion'
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:69: undefined reference to `XF86VidModeQueryExtension'
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:81: undefined reference to `XF86VidModeGetGammaRampSize'
backend/video/libol_backend_video.a(x11.c.o): In function `ol_backend_video_x11_uninit':
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:112: undefined reference to `XCloseDisplay'
backend/video/libol_backend_video.a(x11.c.o): In function `ol_backend_video_x11_get_gamma':
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:121: undefined reference to `XF86VidModeGetGammaRamp'
backend/video/libol_backend_video.a(x11.c.o): In function `ol_backend_video_x11_set_gamma':
/home/tankypon/Nightly/openlux/src/backend/video/x11.c:130: undefined reference to `XF86VidModeSetGammaRamp'
collect2: error: ld returned 1 exit status
src/CMakeFiles/openlux.dir/build.make:167: recipe for target 'src/openlux' failed
make[2]: *** [src/openlux] Error 1
CMakeFiles/Makefile2:79: recipe for target 'src/CMakeFiles/openlux.dir/all' failed
make[1]: *** [src/CMakeFiles/openlux.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

But the compilation works. Output of the cmake command:

-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28") 
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- checking for module 'xxf86vm'
--   found xxf86vm, version 1.1.3
X11: on
iOS: 
Building with X11 support
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tankypon/Nightly/openlux/build

Can't link too

I got your answer on your WP-site. I have the same errors.
Cheers Bernhard S.
cmake
undefined_references

Release tagging

Since you've just incremented the version number, can I suggest at least tagging each new version release going forward? This way, anyone who needs to use an older release for whatever reason can do so without having to go through the entire commit log manually to find each "bump" reference.

Thanks!

Unable to load video backend

I tried the latest version of this program but when I run it I got this error: '[ERR] Unable to load video backend'

can't choose screen to apply

when I have two screens connected to my computer I'm unable to choose which screen to apply openlux to. Is this already possible via terminal emulator and i'm just unaware of that feature or is this something that needs to be addressed in the code?

Copyright

I am trying to package your code for Ubuntu/Kubuntu however I have a few questions regarding the copyright.

I require an authors email for the copyright section, also it is standard practice to include your full name as the copyright holder. Do you intend to release it under GPL?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.