lixo.org

Extreme GTD With Fast User Switching

I’ll be the first to admit I have a serious procrastination problem, but I’ll refrain from examplifying much, here: let the tall pile of dirty dishes by the kitchen sink that’s been hanging around for as much as a week be enough proof of that.

So, I heard about Getting Things Done, and it sounded like a good idea, but sound doesn’t really propagate in the comfortable vacuum of slacking off the whole weekend on the couch, feet up, reading a book. I needed something to enforce it, something that would beat me up if I didn’t do what I had to do. I tried all sorts of calendars, to-do lists, a big whiteboard next to the fridge, and nothing really worked.

Last night I came across a brilliant solution by Merlin Mann. You should have a look at the link if you want to understand the details, but it basically boils down to this:

require 'active_support'

def kill_procrastination(count=5, work=10, rest=2)
  count.times do
    puts 'get moving!'
    sleep work.minutes

    puts 'take a break'
    sleep rest.minutes
  end
end

kill_procrastination()

That’s it, really. But puts doesn’t quite work, as it’s easy to miss a line being printed on the console. I could add a ‘\a’ (beep), but it gets annoying too quickly. Also, it doesn’t really enforce anything.

What if we had two users logged on the machine, one for actual work and another for your web-browsing, instant-messaging, mail-reading, kittie-porn-dwelling lazy ass, and used this script to automatically switch between them?

The Fast User Switching feature of MacOS X can be controlled via shell commands, so it’s a perfect fit. Here’s the script I’m using:

require 'active_support'

def kill_procrastination(
       # tweak these values to your attention span and environment
         work_user='work'
         rest_user='rest'
         count=5,
         work=10,
         rest=2)

  # should be in a single line
  cmd = '/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID '

  count.times do
    `#{cmd} #{work_user}`
    sleep work.minutes

    `#{cmd} #{rest_user}`
    sleep slack.minutes
  end
end

kill_procrastination()
I made Adium change my status to away everytime I switch away from the user, so neither my work nor personal IM accounts interfere with what I’m doing. I still haven’t decided what to do about iTunes, though. Any suggestions welcome!