One of my former colleagues pointed me out to this very cool tool: Blueproximity. In short what it does, automatically lock your screen when a bluetooth device is outside of given boundaries.
Not only can you lock your pc, but you can also unlock it or kick off any script you like. It should be possible to do the following: Lock PC, set Pidgin messenger to away, mute audio… The list is endless. Read the extensive Ubuntu how to here. Thanks Patrick for sharing.