I'd suggest starting the ssh-agent before X because otherwise tasks spawned outside a shell don't have access.
#!/bin/sh eval `ssh-agent -s -t 900`