I was able to use the 'xdotool'xdotool under Ubuntu 11.04 beta, but the 'selectwindow'selectwindow was not a valid command, I had to hack a script with:
$ while true; do sleep 1; xdotool getactivewindow; done
$ while true; do sleep 1; xdotool getactivewindow; done
then watch the window ID go by while I selected the window I wanted, then decoded the responsible PID with:
$ xdotool getwindowpid <the-window-id>
$ xdotool getwindowpid <the-window-id>