Professional Documents
Culture Documents
AvoidingEyeStrainLinuxMagazine
ColorTemperatureTools
By
FedericoKereki
Doyouhaveproblemsgettingtosleepafteralatenightcomputersession?Doesthemonitor
brightnesshurtyoureyes?SeveralLinuxtoolsareavailablethatcouldhelpwiththeseproblems.
Mostpeopleareatleastsomewhatfamiliarwiththenotionofthecircadianrhythm,an
approximately24hourcycleofbiologicalprocessesinhumanbodies.(Thewordcircadian
comesfromLatincircadiesmeaningaboutaday.)PracticallyeveryorganismonEarthfollows
suchacycle,althoughnotalwaysinthesamewayforexample,manyhumansworkduringthe
dayandsleepatnight,whereasnocturnalanimalssleepduringthedayandforageatnight.The
principleremains:Activitiesofallanimalsfollowsuchcyclesandhavebeendoingsofor
hundredsofthousandsofyears.
Thehumanbodyfallsintothiscyclebyfollowingexternalcues,calledzeitgebers(from
Germanzeitmeaningtimeandgebenmeaningtogive)themainzeitgeberislight.Most
animalsevolvedbeingexposedtodifferentlightconditionsinthemorning,duringtheday,andat
night.
Humansarediurnalanimalsthus,ourbodiesunderstandthatbrightwhitelightmeansbe
alert,movearound,dothings,whereasmorereddish,lessintenselightmeansslowdown,
seekshelter,gotosleep.Thisisntaculturalthing,butratherabehaviorbroughtforwardby
evolutionarycommonsense,asfavoredbynaturalselection:Humansarenotwellequippedwith
nightvision,sowanderingaroundatnightisaneasywaytobecomedinner!
Ontheotherhand,humansarequiteadeptatmessingwithnature,andmanmadelightscan
skewthisnaturalcycle,disturbingyoursleepandprovokingeyesightproblems.Forexample,
yourbodymightrespondtothebright,white/bluishlightfromyourmonitororTVsetasifitwere
daylight,rampingupforactioninsteadofpreparingforrest.Readingbycandlelight,lamplight,or
firelightisnotasdisruptivebecauseyouaregettingayellowish/reddishlightthatmatchesthe
evening,soyourbodypreparestosleep.
UnlessyoudecidetostopusingcomputersandTVslateintheday,youllhavetofindsomeway
tohelpyourbodyadjust.Fortunately,severaltoolscanbeofservice.Thesetoolsdotheirjobby
slightlychangingthetintandbrightnessofyourmonitorscreen,soyourbodygetsthekindof
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
1/12
3/26/2016
lightitwouldexpectgiventhetimeoftheday.Ofcourse,thesetoolsarentapanacea,andifyou
dontgetenoughsleep,youcanstillsufferfromnegativesideeffects.
F.luxAFlexibleOption
ThefirsttoolIllconsiderisf.lux.ItisavailableforLinuxaswellasWindowsandMaccomputers,
includingiPhonesandiPads,soitsquitelikelyyoullbeabletouseit.Thelatestversionisdated
July2010,butItesteditonanUbuntu12.04machine,anditworkedfine.
F.luxworksbydynamicallychangingthescreencolorfromcoolwhiteduringthedaytoawarm
yellowishtoneatnight.Toseetheeffectmoreclearly,youcantrychangingthescreen
backgroundfromUbuntu(thestandardbrown/purpledesign)toLondonEyefromBeneath,
whichismorewhite/gray.Figure1showsUbuntusstandard,unmodifiedlook.
Figure1:ThisiswhattheUbuntudesktopusuallylookslikeeitherwithoutf.luxorduringtheday.
Installationoff.luxissimple(Listing1),andtosetitup,allyouhavetodoisspecifyyourlatitude
andlongitude.
Listing1:Installingf.luxfromaPPA
sudosu
add-apt-repositoryppa:kilian/f.lux
apt-getupdate
apt-getinstallfluxgui
exit
(YourZIPcodeisavalidalternativeifyouareintheUnitedStates.)Thefirsttimeyourunfluxgui
(Figure2),itwillaskfortheseparameters.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
2/12
3/26/2016
Figure2:Thefirsttimeyouusef.lux,itwillremindyoutosetupyourlocationdata.
Ifyoudontknowyourcoordinates,clickonFindyourlatitudeandlongitudeandabrowser
windowwillopentofindtheinformationthroughGoogleMaps(Figure3).
Figure3:FindingyourcoordinatesiseasierwithGoogleMaps.Dontworrytoomuchaboutprecision!
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
3/12
3/26/2016
Enteryourcurrentaddress,pressGo!,andyour(possiblyonlyapproximate)locationwillbe
shownonamap.Dontworryifitsnotyourexactpositionallf.luxneedstoknowisthelocal
timeatyourcity.Copythecoordinatesshownatthebottomofthescreenandpastetheminto
thef.luxGUIwindownotethatlatitudeandlongitudegointoseparatetextboxesandyoure
set(Figure4)!
Figure4:Aftergettingyour(approximate)coordinates,entertheminthef.luxGUI,checkifyouwantitto
autostart,andpickyourpreferredcolortemperature.
Youmightwanttoadjustsomeothersettings,too.IdsuggestcheckingAutostartf.luxindicator
applet,soitwillrunautomatically.Also,youmustpickthedesiredkindoflightingyouwantat
night.YouroptionsareTungsten,Halogen(thedefault),Fluorescent,andSunlight.Youll
probablywantoneofthetwofirstoptions.Throughouttheday,f.luxwillprogressivelyadjustthe
screenlighting,frommaximumbrightness(aroundnoon)toyourselectedvalue(atnight).The
changeisgradual,butbycomparingFigures1and5,youcanseethedifferencethis
screenshotwastakenaroundmidnight.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
4/12
3/26/2016
Figure1:ThisiswhattheUbuntudesktopusuallylookslikeeitherwithoutf.luxorduringtheday.
Figure5:TheUbuntudesktoparoundmidnight,showingamarkedlywarmertonethanthedaytimedesktop(in
Figure1).
SeetheboxWhatAreColorTemperatures?formorespecificinformation.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
5/12
3/26/2016
Youcanalsoruntheunderlyingxfluxcommand(whichcontrolsthelighting)fromthecommand
line:
/usr/bin/xflux -l -35 -g -56 -k 2700
ThisexamplesetsyourcoordinatestoMontevideo,Uruguay(roughly35South,56West),and
thecolorto2700K(Listing2).
Listing2:f.luxfromtheCommandLine
>xflux-l-35-g-56-k2700
-------Welcometoxflux(f.luxforX)
Thiswillonlyworkifyou'rerunningXonconsole.
Yourlocation(lat,long)is-35.0,-56.0
Yournight-timecolortemperatureis2700
It'snighttime.Yourscreenischangingnow.
Goingtobackground:'kill15960'toturnoff.
Thecommandlineusageprovidesasimplewaytousef.luxinanyLinuxsystemyoucouldset
upasimplecommand(asfollows)andmakeitautostartonlogin.Notethatheretheoutputof
thexfluxcommandissenttoafile(/tmp/xflux.out),soyoucanlearnthecommandsPIDand
eventuallykillitifdesiredalthoughyoucouldalsokillallxflux.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
6/12
3/26/2016
#!/bin/bash
xflux -l -35 -g -56 -k 2700 >/tmp/xflux.out
Withallitspossibilities,f.luxisstillasimplesolution,mostlyforUbuntuandderiveddistributions.
WhenyoucantakeadvantageoftheGUIcontrol,itsdefinitelyworthatry!
RedshiftACommandLineSolution
Redshiftwasinspiredbyf.lux(theauthorsayshewroteitoutofdissatisfactionwithsome
aspectsoftheLinuxversionoff.lux),anditslatestversionis1.7,datedJuly2011.Itwaswritten
forLinux,butexperimentalbuildsareavailableforWindows.Whenenabled,Redshiftalsoworks
byperiodicallychangingthescreentinttomatchthetimeofday,accordingtoyourcurrent
coordinates.Ifyouwanttotryoutaspecificsetting,youcanrunitinsingleshotmode(seethe
oandOparametersinTable2)andwhatevercoloryoupickwillremainunchanged,despite
whattheclocksays.
Astoinstallation,theRedshiftwebsiteofferspackagesformanydistributions(ArchLinux,
Debian,Fedora,Ubuntu,etc.),andifyoulookaround,youcanprobablyfindevenmore
repositories.Forexample,foropenSUSE,Iusedthepackagesearchfunctionandfoundthatthe
X11Utilitiesrepositoryincludedit.
BecauseIwantedtotryadifferentapproachthanusingarepository,IdecidedtoinstallRedshift
inLinuxMintthroughthecommandline.LinuxMintisderivedfromUbuntu,sothePPAprobably
wouldhaveworked,butIwantedtoshowadifferentway,soIdownloadedpackagesfromthe
Redshiftsiteandthenenteredthefollowinglinesatthecommandline:
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
7/12
3/26/2016
Figure6:LinuxMintwithoutRedshift,oratnoon.
Figure7:LinuxMintwithRedshiftrunningfromthecommandlinelateratnight.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
8/12
3/26/2016
Ifyouwanttotryaspecificcolortemperature,youcanusesomethinglike:
redshift -O 4000
Enteringredshiftxrestoresthescreentonormal.
Anindicatorisalsoavailableifyouentergtkredshiftinsteadofredshift,asmalliconshowinga
redorbluelampwillappearinyoursystemtray.Byclickingonthelamp,youcanenable(red
lamp)ordisable(bluelamp)Redshift.Youcanalsosetittoautostart,oryoucankillitcompletely
usingQuit(Figure8).
Figure8:TheRedshiftsystemtrayiconworksequallywellinGnomeandKDE.
Redshiftworksverywellfromthecommandline,anditssystemtrayiconprovidesfeedback
althoughnotawaytoconfigureit.Ihaveuseditwithseveraldistributionsinwhichitperformed
quitewell,soitsworthtryingout.
CaliseAWebcamAwareOption
Caliseisthenewcomer,anditslatestversionis0.4.0,datedJuly2012.Itworksdifferentlyfrom
f.luxandRedshiftinthatitwontchangethescreencolor.Instead,itadjuststhescreenbacklight
upordowndependingonthecurrentlighting,asdetectedbythewebcam(henceitsname:
CalisestandsforCameraLightSensor).Ifyouareworkinginthedarkwhateverthetimeof
dayCalisewilllowerthelightingofyourscreen,andifyouareinafullylightedambient,Calise
willsetthescreenbacklightingtomaximum.(Figures9and10).
Figure9:ThestandardopenSUSEdesktop,withoutCaliserunning.
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
9/12
3/26/2016
Figure10:Atnight,Caliselowersthebrightnessofthemonitorbacklight.
TouseCalise,youwillobviouslyneedawebcamandamonitorwithcontrollablebacklight.Ifyou
arenotsureaboutthelatteritem,checktoseewhetherdirectory/sys/class/backlightexistsand
thatitisnotemptyifitis,youllprobablybeabletorunCalise.Becauseoftheserequirements,
inmyparticularcase,IcanrunCaliseonmylaptopbutnotonmydesktopmachines.
CaliseisaPythonapplication,anditcanbeinstalledinseveraldistributionssuchasArchLinux,
Ubuntu,Fedora,oropenSUSE.Giventhattheprojectisinfluxrightnow,youshouldcheckthe
InstallationpageattheCalisewiki,becauseitsquitelikelythatsetupinstructionswillchange
withfuturereleases.ChecktheCalisewebsite,toorightnow,therearethreepatchesthatyou
shouldapplytothe0.4.0version,andyoucanfindtherequiredcommandsonline.
Followthewikiinstructionstoproceedafterinstallingandpatchingthesourcecode.Youll
probablyhavetoinstallseveralpackagesbeforeattemptingtobuildandinstallCalise.The
documentationisclearonthatandprovidestherequiredcommands.Next,changetothesource
directoryandrunthefollowingcommands.
env python2 setup.py build
sudo env python2 setup.py install --prefix=/usr
Youmightgetanerrormessage,suchasERROR:Pythonmodulemsvcrtnotfound,butdont
worrymsvcrtisaWindowsmoduleanddoesntexistinLinux.Again,checkthewikifor
commandsthatshouldberunafterthisinstall.Dependingonyourdistro,youmighthavetodo
someextrawork.
Afterasuccessfulinstallation,youcancalibrateCalisebyrunning:
calise --calibrate
Youcanhaveseveralnamedprofilesforuseatdifferentplacesforexample,oneprofileforyour
workplaceinthedayandanotherforyourroomintheevening.Youllhavetospecifythe
backlightdirectory,thenCalisewillcheckthatitworksanddeterminehowmanypossiblevalues
yourmonitorsupports.CalisewillthentrytodetermineyourcoordinatesfromyourIPorletyou
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
10/12
3/26/2016
enterthemmanually.
Finally,Calisewillaskyoutochoosewhichcameratouse(ifmorethanone)andinvolveyouin
acoupleofexperiments(includingcoveringthewebcamslenswithyourfinger)tofinishits
setup.
Calisealsohasasystemtrayiconorindicatorandagraphicinterface(Figure11)withwhichyou
canstartorstopthebrightnesschanges.However,theauthorrecommendsrunningtheprogram
indaemonmode,withcalised,whichrequireslessCPUandpowerusage.
Figure11:Calisealsoprovidesagraphicinterfacethatshowsitsstatusandletsyoustartandstoplight
balancing.
Calisebehavesdifferentlydependingthetimeoftheday.Betweendawnandsunset,itdoes
relativelyfewscreenadjustments.Atdawnandsunset,itdoesfrequentscreencapturesto
followtherapidlyvaryinglightconditions,and,atnight,itmakesthefewestnumberof
adjustments.
Caliseisanotherinterestingtool,thatmightprovemostusefulincombinationwithacolor
temperaturetoolfeelfreetoexperiment.
SummingUp
Workingatnightcandisruptyoursleepinghabitsandsleepcyclesandevenresultinhealth
problems,butLinux,asusual,providesseveraltoolstohelpyoucopewiththisproblem.Seethe
boxtitles"WhataboutAndroid"tolearnaboutalternativetoolsformobiledevices.Givethetools
inthisarticleatryandseewhetheryoustartfeelingbetter!
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
11/12
3/26/2016
Info
http://www.linux-magazine.com/Online/Features/Avoiding-Eye-Strain
12/12