For anyone coming to this question because of OSX Lion/Mountain Lion + launchd/startup items/LoginHook issues, I have a solution that helped me.
SynergyKM on OSX *Lion is unreliable. Furthermore, I was never able to get my synergy client working via any of the ways outlined at http://synergy2.sourceforge.net/autostart.html. What I did was write a shell script and then converted that script into a Mac Application with Platypus.
Here are the exact steps I followed:
There are known issues with the latest synergy version's compatibility with OSX Lion so we get the compatible version (1.3) from MacPorts.
- Open Terminal
- If you don't have it already, install MacPorts
- Once MacPorts is installed, do a "sudo port install synergy".
- At the command line do a "which synergyc" to make sure it points to "/usr/bin/synergyc"
- From the command line execute a "synergyc --version" to ensure it's version 1.3
- Create a "bin" directory under your user directory
- Write your shell script
- Replace the synergy server address (my synergy server IP address is 192.168.0.30) with the IP address of your synergy server. (Using the IP address ensures the client can accurately find the server.)
- Save and exit
- Execute "chmod 755 synergy.sh"
Shell script code:
if ! ps axco command | grep -q "^synergyc\$"
$SYNERGYC -n $(hostname -s) -1 -f 192.168.0.30
echo "synergyc already running."
- Install Platypus
- App Name: "Synergy"
- Script Type: "Shell" @ /bin/sh
- Script Path: /Users/[your osx username]/bin/synergy.sh
- Output: Progress Bar
- Keep the other generated properties as-is
- Click the "Create" button
- Select where to output the Synergy.app
Tying It All Together
Now that you have a fully functional Mac application, do the following steps to finish your automatic synergy client setup.
- Open "System Preferences"
- Open "Users & Groups"
- Go to the user for which you want to add synergyc startup
- Click the "Login Items" button
- Click the "+" button to add the "Synergy.app" app you created with Platypus
- Logout and log back in to ensure synergcy starts up right away.
- You are DONE!