Stop iMac from sleeping when used as an external display I have an iMac which I sometimes use as an external display for my Macbook Air. Normally, I want the iMac to go to sleep after about 30mins except when I have the Air attached.

Is there any app (or Applescript?) out there which will change/disable the sleep time when it's being used as a display, but still let the iMac sleep when the Air is not connected?
Theres a very popular app called caffeine that sits an icon in your menu bar, and when you click it the app prevents your computer from sleeping either indefinitely or for a predetermined period of time.