Two possible methods:
I already use a time-tracking application of some kind and thus am in the habit of telling my computer when I'm working—and by implication when I'm not working on anything in particular.
I don't use a time-tracking application, but I have an application that has certain triggers that tell it I'm in the middle of leisure. For instance, if I've spent more than 30 seconds on facebook.com. Or the computer's been idle for more than 10 minutes—and my phone reports that I'm still at home.