How to avoid "working" in bed. Attach my laptop to my desk?



suck out the battery of your laptop forever and use it only with 1 DC cable at your desk. That way you will be forced to stay at your desktop. Or change your working-laptop into a PC tower for your desk, which will stay there all the time (with a monitor).
 
Psychology says, don't work where you sleep. It messes up your head space.
If you sleep where you work, chances are you won't be getting a good night's sleep.
Motivate yourself by placing your alarm in your work table. This way, you'll be
forced to stand up to start the day.