<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechNullogy &#187; AppleScript</title>
	<atom:link href="http://www.technullogy.net/index.php/tag/applescript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technullogy.net</link>
	<description>Musings of a convert to nerdism</description>
	<lastBuildDate>Thu, 22 Jul 2010 19:43:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Synergy: Share Mouse and Keyboard between multiple computers with different operating systems</title>
		<link>http://www.technullogy.net/index.php/2009/09/10/synergy-share-mouse-and-keyboard-between-multiple-computers-with-different-operating-systems/</link>
		<comments>http://www.technullogy.net/index.php/2009/09/10/synergy-share-mouse-and-keyboard-between-multiple-computers-with-different-operating-systems/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 01:36:20 +0000</pubDate>
		<dc:creator>MJ Hufford</dc:creator>
				<category><![CDATA[General Musings]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[AS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[Screen Share]]></category>
		<category><![CDATA[Synergy]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.technullogy.net/?p=142</guid>
		<description><![CDATA[Synergy rocks. In their own words: Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It&#8217;s intended for users with multiple computers on their desk since each system uses its own monitor(s).  Redirecting the mouse and keyboard is as [...]]]></description>
			<content:encoded><![CDATA[<p><a title="CLICK IT!" href="http://synergy2.sourceforge.net/">Synergy rocks.</a> In their own words:</p>
<blockquote><p>Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware.  It&#8217;s intended for users with multiple computers on their desk since each system uses its own monitor(s).  Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen.  Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. Furthermore, it synchronizes screen savers so they all start and stop together and, if screen locking is enabled, only one screen requires a password to unlock them all.  <a href="http://synergy2.sourceforge.net/about.html">Learn more</a> about how it works.</p></blockquote>
<p>Synergy has been around for awhile.  I don&#8217;t pretend to be revealing a hidden gem.  So why do I share?  Because I&#8217;ve got an interesting setup that I hope someone else may find useful!  Also, my mother told me to share.</p>
<p>The majority of my time at work is spent in .NET development.  I have a MacBook Pro configured to dual boot to Windows 7 (Boot Camp) and it runs like a champ.  My company&#8217;s VPN is such that it disables connections to the general internet.  When I connect to my VPN, I lose my internet connection.  Nooo, it doesn&#8217;t support split tunneling or allow me to clear the &#8220;Use gateway on remote network&#8221; checkbox.  So if I want to work from home AND have an internet connection&#8230;.enter Synergy!  Synergy allows me to control my Windows 7 laptop AND my iMac with a single keyboard and mouse. Also, Synergy connected systems share clipboard settings.  Awww yeeaaah!</p>
<p>I setup my windows laptop as the Synergy server like so:</p>
<table border="0">
<tbody>
<tr>
<td><img class="size-medium wp-image-152 alignnone" title="synergyScreenConfig" src="http://www.technullogy.net/wp-content/uploads/2009/09/synergyScreenConfig-202x300.jpg" alt="synergyScreenConfig" width="202" height="300" /></td>
<td><img class="size-medium wp-image-153 alignnone" title="synergyServerConfig" src="http://www.technullogy.net/wp-content/uploads/2009/09/synergyServerConfig-300x210.jpg" alt="synergyServerConfig" width="300" height="210" /></td>
</tr>
</tbody>
</table>
<p>Next, I created a couple basic AppleScript scripts to connect to and disconnect from the server. The startup script assumes that you have the synergy client in a folder called &#8220;synergy&#8221; in the root directory.</p>
<p>Client Connect (technically, you can do this without &#8220;tell application&#8221;, but I like the visual):</p>
<pre><span style="color: #0000ff;"><strong>tell</strong></span> <span style="color: #0000ff;">application</span> "Terminal"
 <span style="color: #0000ff;">activate</span>
 <span style="color: #0000ff;">do script</span> "/synergy/synergyc -f &lt;ServerHostNameOrIpAddress&gt;"
<span style="color: #0000ff;"><strong>end tell</strong></span></pre>
<p>Client Disconnect:</p>
<pre><span style="color: #0000ff;"><strong>set</strong></span> <span style="color: #68c364;">synergyName</span> <span style="color: #0000ff;"><strong>to</strong></span> "synergy"

<span style="color: #0000ff;"><strong>set</strong></span> <span style="color: #68c364;">synergyPid</span> <span style="color: #0000ff;"><strong>to</strong></span> (<span style="color: #0000ff;">do shell script</span> "ps ax | grep " &amp;
  (<span style="color: #0000ff;">quoted form</span> <span style="color: #0000ff;"><strong>of</strong></span> <span style="color: #68c364;">synergyName</span>) &amp; " | grep -v grep | awk '{print $1}'")

<span style="color: #0000ff;"><strong>if</strong></span> <span style="color: #68c364;">synergyPid</span> <strong><span style="color: #0000ff;">is</span> <span style="color: #0000ff;">not</span></strong> "" <span style="color: #0000ff;"><strong>then</strong></span> <span style="color: #0000ff;">do shell script</span> ("kill -9 " &amp; <span style="color: #68c364;">synergyPid</span>)</pre>
<p><a href="http://synergy2.sourceforge.net/">Download Synergy</a><br />
<a href="http://www.box.net/shared/bf2ysiu8yo">Download Synergy Client Launch AppleScript</a><br />
<a href="http://www.box.net/shared/nilnx7cso0">Download Synergy Client Kill AppleScript</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.technullogy.net/index.php/2009/09/10/synergy-share-mouse-and-keyboard-between-multiple-computers-with-different-operating-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
