I'd like to automatically start a music player when the light is turned on and stop it when the light is turned off. I didn't find any cheap USB light sensor, so I decide to go with a 4$ webcam.
Thanks to ImageMagick, mplayer and stackoverflow, this is ...