Launch synergy client on boot in Mac OS X

Have you tried the explanation here (scroll down to the bottom) about autostart on the Mac?

I’ve got it to work that way, and I can log on using the keyboard of my PC.


The synergyc and/or synergys files have to be owned by root. "On-demand launch of the Window Server is allowed for root user only", the message says.

chown root:wheel /wher/ever/synergy* and then Synergy will be regarded as root.

Also see http://ajaydesai.blogspot.com/2009/03/setting-up-synergy-client-mac-os-x-1056.html


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:

MacPorts Synergy

There are known issues with the latest synergy version's compatibility with OSX Lion so we get the compatible version (1.3) from MacPorts.

  1. Open Terminal
  2. If you don't have it already, install MacPorts
  3. Once MacPorts is installed, do a "sudo port install synergy".
  4. At the command line do a "which synergyc" to make sure it points to "/usr/bin/synergyc"
  5. From the command line execute a "synergyc --version" to ensure it's version 1.3

Shell Script

  1. Create a "bin" directory under your user directory
  2. Write your shell script
  3. 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.)
  4. Save and exit
  5. Execute "chmod 755 synergy.sh"

Shell script code:


#!/bin/sh
SYNERGYC=/usr/bin/synergyc

if ! ps axco command | grep -q "^synergyc\$"
then
    $SYNERGYC -n $(hostname -s) -1 -f 192.168.0.30 
else
    echo "synergyc already running."
fi

Platypus

  1. Install Platypus
  2. Open
  3. App Name: "Synergy"
  4. Script Type: "Shell" @ /bin/sh
  5. Script Path: /Users/[your osx username]/bin/synergy.sh
  6. Output: Progress Bar
  7. Keep the other generated properties as-is
  8. Click the "Create" button
  9. 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.

  1. Open "System Preferences"
  2. Open "Users & Groups"
  3. Go to the user for which you want to add synergyc startup
  4. Click the "Login Items" button
  5. Click the "+" button to add the "Synergy.app" app you created with Platypus
  6. Logout and log back in to ensure synergcy starts up right away.
  7. You are DONE!

This is no longer possible with the current version of Synergy (1.7.1) + OSX (10.10 Yosemite) Check this issue:

  • Unable to use Synergy to login to OSX

One workaround is to use auto-login (ew) for the user with the agent/daemon but then you can't lock your system by logging out. Interestingly enough, you can show the login window while still logged in and the keyboard works but not the mouse.