I wanted an easy way of hooking workrave up with other programs. I figured being able to call an external script was the easiest way of accomplishing this. This patch causes workrave to look for and run the script ~/.workrave/statechange using '/bin/sh'. The script gets passed two arguments: the first argument is the new state, the second is the prior state. What these mean can be found in /backend/src/ActivityMonitorInterface.hh. At the moment, the important ones are State 2 (IDLE) and State 4 (ACTIVE).