9.15.2008

synergyc startup

i've been using synergy lately to share a keyboard and mouse between a linux box and my macbook. for whatever reason, synergy was crashing in daemon mode and i really hated keeping a terminal window open just to keep it running. so, with the help of lingon and launchd, i devised a nice solution that causes synergyc to launch in the background every time i login.

all you have to do is place the following snippet in ~/Library/LaunchAgents/net.sourceforge.synergy2.synergyc.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>Label</key>
 <string>net.sourceforge.synergy2.synergyc</string>
 <key>ProgramArguments</key>
 <array>
  <string>/opt/local/bin/synergyc</string>
  <string>-f</string>
  <string>-n</string>
  <string>macbook</string>
  <string>SERVER_HOSTNAME</string>
 </array>
 <key>RunAtLoad</key>
 <true/>
</dict>
</plist>

Be sure to replace SERVER_HOSTNAME with the hostname of your server, modify the path to synergyc for your installation and delete or change the -n and the macbook to reflect your synergy configuration.