source ~/.keychain/${HOSTNAME}-sh
# to allow p4v to use keychain instead of launchd
cat <<EOT > ~/.MacOSX/environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SSH_AUTH_SOCK</key>
<string>$SSH_AUTH_SOCK</string>
</dict>
</plist>
EOTThe one limitation is that you must start your Terminal before launching anything that uses keychain, but since I start Terminal as soon as I log in, that's not a problem.



