In general though I am motivated by accomplishment. I feel good about doing a good job. It is its own reward. I feel that I've had a good day's work when I've contributed something worthwhile that has improved the code, the company or my team in some way, even if it's small.
I keep my work days structured around the traditional 9-5. At first it was out of habit but I've since embraced it as a discipline. The difference for me, I believe, is that without a long commute and being stuck in an office far from home there is very little cost associated with following "sporadic" opportunities. I don't leave time out for them because the benefits tend to out-weight the cost of being away from my desk. I can get up and take a walk down to my local café, chat with the barista about local events and pick up some flowers for my wife on the way home. This relieves stress, breaks up monotony and gives me time and space to connect the hunches together in my mind. I may come back from that outing with the solution to my problem or I may not; but at the very least I will be reinvigorated to take on the next set of tasks ahead of me and it cost the team almost nothing and gained quite a bit.
The way I see it my employer was looking for someone who was smart, experienced, creative and responsible. I do everything I can to cultivate that in myself. They're not paying me to trade hours for lines of code. They need someone with my experience, knowledge and intuition to help them solve problems and build a solid product.
If the solution to our problems as programmers could be solved by rote then I'd be out of work and in a different profession.