The solution that worked for me the most:
http://en.wikipedia.org/wiki/Timeboxing
Plan out your schedule for the entire day (as detail as possible, i.e. when to have lunch and for how long) the day before and follow it.
The key is to get into the habit of timeboxing. Forget about tricks. There's no easy way out. You have a bad habit of procrastination. It will take much effort to undo that.