Live data from Hacker News

Setting Emacs theme based on ambient light

matthewbilyeu.com

21–27 of 27 posts

Re: Setting Emacs theme based on ambient light

#21
post #3

I've had this in my vimrc for a little while: let hr = (strftime('%H')) if hr >= 17 set background=dark elseif hr >= 7 set background=light elseif hr >= 0 set background=dark endif Using a light sensor would be cool, but I actually work from a desktop PC most of the time, so no sensor. I guess the next best thing would be something like f.lux does: query some web service for the sunset time at your current location.

It is possible to purchase a small USB lux meter: http://www.yoctopuce.com/EN/products/usb-environmental-senso... I use one to automatically adjust the brightness of my Dell display.

what display and how do you control your display from your PC?

Re: Setting Emacs theme based on ambient light

#24
post #6

is the background color really the problem? I though screen brightness was a more issue, for example: continue using your light theme but lower down the brightness, most of your websites are going to be white backgrounds, switch between dark and light background frequently strains more the eyes, looking for the link where I read this.

I use the browser extension 'dark background light text' [1] for that reason. Works OK, far from perfect, but helps quite a bit.

[1] https://github.com/m-khvoinitsky/dark-background-light-text-...

Re: Setting Emacs theme based on ambient light

#26

Earlier quoted context omitted.

It is possible to purchase a small USB lux meter: http://www.yoctopuce.com/EN/products/usb-environmental-senso... I use one to automatically adjust the brightness of my Dell display.

what display and how do you control your display from your PC?

I have a Dell P4317Q, a great 43 inch display, and control it from my Mac with ddcctl: https://github.com/kfix/ddcctl
Post reply on HN