More information is needed. How does it not work? What are the specific symptoms?
If you have 6 or more keys in the agent at any given time, then you would need to use both IdentityFile and IdentitiesOnly for each remote account + remote host.
As for the line you see, that is normal. Launching a window manager via
ssh-agent is an easy means of having it import the relevant environment variables. Otherwise, you'd have to add them manually for each and every program you launch including every terminal window you open. Open a terminal window and verify that these variables are getting passed:
You should see the values for both SSH_AUTH_SOCK and SSH_AGENT_PID there.