Autostarting the Synergy Server on Mac OS X using launchd
Synergy is a terrific tool that allows multiple machines on a network to share one set of Mouse/Keyboard.
The typical application is probably a setup like mine: since I bought a Dell 2407WFP (I really recommend this store, the prices are amazing and the owner is a very nice and helpful guy) a few months ago, I couldn't bring myself to stare a my laptops crappy screen any longer. Placed right under the monitor, it uses the Dell as its display now, connected by VGA while my Mac mini is connected by DVI. Switching inputs on the Monitor isn't a problem but actually operating the laptop with its lid closed is kinda difficult. Since both computers are in my LAN, I use Synergy to share the Mac's Mouse and Keyboard with the Laptop.
Manually starting the Synergy server on the mac works but is quite unelegant. Open Terminal, launch
synergys, quit Terminal.
The instructions for launching Synergy automatically on the Synergy homepage are from the time before Mac OS X 10.4 and don't use launchd for launching, relying on LoginHooks or StartupItems instead.
Launching via launchd is neither difficult nor very original but since Information on this is a little hard to find, I wanted to share my synergy launchd here:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//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.syngery2</string> <key>OnDemand</key> <false/> <key>ProgramArguments</key> <array> <string>/usr/local/bin/synergys</string> <string>--no-daemon</string> <string>--no-restart</string> <string>--debug</string> <string>WARNING</string> </array> <key>RunAtLoad</key> <true/> <key>ServiceDescription</key> <string>Synergy Server</string> </dict> </plist>
The first program argument has to be adjusted for your system of course. Place this file in
/Library/LaunchAgents. I deliberately did not make this an OnDemand Item since that involves fiddling with
Synergy starts quickly and doesn't use many resources, so this shouldn't be a problem.
Getting the keys to work correctly
WIN keys don't work correctly when connecting a Windows client to a Mac server. To fix this, add these lines to your windows client in the screens section in
alt = super super = alt