3 ms·
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
by auxym 9y ago
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.
- gkya 9y agoI have this old and slightly buggy vim plugin [1] which uses py-ephem to determine the correct moment to switch themes every day. It's been quite a while since I've used vim and I don't maintain this, but you may want to chech it out. BTW, if there's anybody that wants to take over it, please contact me via a github issue through the repo below. [1] https://github.com/cadadr/vim-sunflower https://github.com/cadadr/vim-sunflower
- TwistedWave 9y agoIt is possible to purchase a small USB lux meter: http://www.yoctopuce.com/EN/products/usb-environmental-sensors/yocto-light-v3 http://www.yoctopuce.com/EN/products/usb-environmental-senso... I use one to automatically adjust the brightness of my Dell display.
- tobyhinloopen 9y agowhat display and how do you control your display from your PC?
- TwistedWave 9y agoI have a Dell P4317Q, a great 43 inch display, and control it from my Mac with ddcctl: https://github.com/kfix/ddcctl https://github.com/kfix/ddcctl