Thoughts on Systems

Emil Sit

Jun 25, 2008 - 1 minute read - Hacking howto programming tools workflow

Reduce your context switch delay

Sometimes, simple shell scripts can save a lot of time. Recently, I noticed myself waiting for various unit tests to complete by surfing the web: a surefire way to be distracted for more than the time it takes for the tests to complete (or fail). Enter the following script, which I call notify:

xmessage -center "$(basename $1) done, status $status"
exit $status

You run it like this:

notify make all

at which point make runs along merrily. Of course, you replace make with whatever command you run that takes a long time to complete. When make exits, a small window appears in the middle of your screen that says “make done, status 0”. This immediately notifies you to stop surfing and get back to work.

So… get back to work!