How do I get a program to run automatically every time I unlock the screen in Ubuntu?
Could be done using the dbus API
(perl example copied from http://live.gnome.org/GnomeScreensaver/FrequentlyAskedQuestions and slightly changed to catch screensaver going on and off)
Next, allow the script to be run:
Add the script to the Sessions manager (System>Preferences>Sessions) so that it starts with your login using this command:
hope this helps