Search this site


Metadata

Articles

Projects

Presentations

How to annoy your coworkers a little less

I'm almost guaranteed to be wearing headphones while at work. I like music. However, when I leave my desk, I rarely pause mplayer. This leaves my headphones leaking out some barely audible nois that may annoy coworkers.

I always lock my workstation when I'm not at my desk. How do I automate a solution here?

xscreensaver lets you watch the state of the screensaver. Let's use this to pause mplayer when I leave, and unpause it when I return.

xscreensaver-command -watch \
  | while read a; do
    echo "$a" | grep '^LOCK' && pkill -STOP mplayer
    echo "$a" | grep '^UNBLANK' && pkill -CONT mplayer
  done
Running the above, mplayer gets suspended when I lock my workstation, and resumed when I unlock it.

4 responses to 'How to annoy your coworkers a little less'

Showing last 4 comments... (Click here to view all comments)

Neil Dunn wrote at Wed Apr 18 14:06:39 2007...
Great tip!

Cheston wrote at Wed Apr 18 22:40:53 2007...
Wow this is a great idea, now nearby peoples will not have to listen to my full Journey playlist.

Jordan Sissel wrote at Wed Apr 18 23:26:16 2007...
@Cheston,

I <3 Journey. Speaking of arena rock... My favorite not-work-related thing about working for Linus in the CS dept was the near constant flow of Rush coming out of his office. Every so often " ... today's Tom Sawyer ..." will invade my brain thanks ot him.

logadmin wrote at Fri Apr 20 07:53:58 2007...
Cool idea, in a similar way in this url
http://rcda.wordpress.com/2007/03/21/bloqueo-automatico-por-bluetooth/
you could find a bash script to lock automatically your screen without your presence and unlock it with your presence (with the help of the a wireless phone).
Regards.
logadmin


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment: