ThingyMaJig

Thingy Ma Jig is the blog of Nicholas Thompson and contains any useful tips, sites and general blog-stuff which are considered interesting or handy!

Connect

LinkedIn GitHub

Topics

announcement 25 apache 3 Apple 1 bash 8 code 7 cool 30 Days Out 8 Dark Basic Pro 4 design 12 doctor who 1 Drupal 74 E4600 1 EOS 400D 3 firefox 2 Flickr 3 free 21 games 5 geek 38 git 2 GreaseMonkey 1 hardware 7 Homebrew 1 How to 37 humour 5 iphone 1 javascript 1 jquery 1 K800i 6 k850i 4 lighttpd 3 linux 33 mac 9 miscellaneous 4 mobile phone 9 music 4 mysql 8 n73 1 n95 1 New Relic 1 Ogre3D 1 OS X 2 performance 3 photos 10 programming 40 Quicksilver 1 review 19 security 3 SEO 6 software 12 svn 2 technology 4 tip 7 tips 10 tv 3 video 3 vim 7 webdev 2 websites 33 wii 1 windows 1 YADS 10

Synergy for OSX Leopard

Posted on 07 July 2008 in
technology software mac How to geek

I recently setup my PC in the living room with my TV so I could play games and watch streamed video from the net (eg, BBC's iPlayer). Unfortunately this always meant having a keyboard and mouse attached.

Then came along Synergy.

[adsense:468x60:4496506397]

Synergy is like a software KVM switch... First you configure the server and teach it where the screens "are" (this will make sense in a minute). You start then server on the machine which has control of the keyboard and mouse - in this case my laptop - and the client(s) - in this case just my PC although you can configure more. The server keeps and eye on where the controlling mouse is on the screens. If you move it off one of the configured edges then you take control of the machine thats configured for that edge. For example, Screen B could be to the right of Screen A (and therefore Screen A is to the left of B - but not necessarily!).

In my case all I have to do on my Mac Book Pro is to nudge the pointer off the top of the screen and I then take control of the PC plugged into my TV!

Nothing is ever easy....

Unfortunately, it appears that Synergy (V1.3.1 at least) doesn't like running in Deamon Mode on OSX 10.5. Deamon Mode allows the server to run quietly in the background without requiring you to have a terminal window open all the time. For some reason it just crashes.

This morning I had a brainwave - the Screen command in UNIX operating systems allows you to start a process and detach it from the terminal! I generally only use this for applications I want to run on a remote machine from which I might get disconnected half way through (eg, if I want to run a long download which I can periodically check back on but dont want to break if my internet connection drops). Normally in UNIX, a process gets tied to the terminal it is run from so if the terminal dies (or the SSH connection to a remote machine), usually the child processes die with it. Screen stops this!

[adsense:468x60:4496506397]

I simply created a startup script like this

#!/bin/sh
screen -d -m /Applications/synergy-1.3.1/synergys --config /Applications/synergy-1.3.1/synergy.conf -f
exit

The -d -m options tell screen to start in a forked and detached mode!

You can then use the Accounts section in System Preferences to tell it to run the startup script upon login! Easy!