photo
Jordan Sissel
geek

Wed, 18 Apr 2007

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.

Comments: 4 (view comments)
Tags: ,
Permalink: /geekery/xscreensaver-hack-to-not-annoy-coworkers
posted at: 15:17


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

Neil Dunn posted at Wed Apr 18 17:06:39 2007...
Great tip!

Cheston posted at Thu Apr 19 01:40:53 2007...
Wow this is a great idea, now nearby peoples will not have to listen to my full Journey playlist.

Jordan Sissel posted at Thu Apr 19 02: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 posted at Fri Apr 20 10: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. Not posted or recorded anywhere, ever)
URL (also optional)
Comment:


Search this site

Navigation

Metadata

Home About Resume My Code

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< April 2007 >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati