Prevent MacBook Pro from going to sleep [duplicate]

Possible Duplicate:
Is there any way to set a MacBook Pro to not sleep when you close the lid?

I would like to prevent my MacBook Pro (2009 version) from going to sleep when I close it. I can do this with a Windows-based laptop, but I could not find an option on the Mac. Is this possible? I want to be able to close it when outputting video to a TV, for example.


Solution 1:

If using Lion, it should not go to sleep when an external display is connected. If it does, you can wake it up with an external keyboard.

Solution 2:

InsomniaX 2.0

does a very good job at this.

enter image description here