sponsor Vim development Vim logo Vim Book Ad

Ambient Theme : Sets your theme's background based on ambient light

 script karma  Rating 1/1, Downloaded by 416  Comments, bugs, improvements  Vim wiki

created by
Leonid Shevtsov
 
script type
utility
 
description
Sets your vim theme's background based on ambient light.

WORKS ON OS X ONLY.

The plugin switches the background variable from light to dark. Works smoothly with solarized.

# Limitations

Vim doesn't have a timer. So this uses a hack which only works in Normal mode. That means the theme will switch after you exit Insert mode.

# Configuration

g:AmbientLightThreshold is the sensor value which triggers the switch. The default is 100000; you can experiment yourself if you want.

echo g:LightSensorValue will let you see the current value.

# Compiling the binary yourself

There's a binary that reads the light sensor value. It is precompiled for OSX 10.5 and later.

You'll need gcc to compile it IF YOU HAVE OSX 10.4 OR LESS. Otherwise, it's as simple as:

make clean; make

---

Git repository: https://github.com/leonid-shevtsov/ambient_theme.vim
 
install details
Requires OS X >=10.5 and an ambient light sensor (like on a MacBook).

Just copy the plugin to your vim path and restart, or use pathogen
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
ambient_theme.tar.gz 0.1 2011-09-30 7.0 Leonid Shevtsov Initial upload
ip used for rating: 3.141.30.162

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github