I assume that you often work using your laptop before going to sleep so you want to go to sleep without having to get up and turn off the light once you are done working.
Am I correct?
Well.. There is a solution
Throw the damn laptop at the light once you are done with it. That way you can turn it of with your laptop.
JK :)
Well, the problem is that a laptop cannot really "connect" to a light or light switch. In any way. No way.
If your lights come with one of those neato remotes, there is a solution. Tape/glue the remote to the lid of your laptop, and once you close the laptop, push the "power" button on your remote. That should do the trick.
Otherwise, you have to rewire your lights to go through some sort of mechanism that can be controlled using a neato remote. Then refer to the method listed above :D
I'm not kidding one bit.