Sunday, February 24, 2008

Synergy: My New Best Friend

I wish I had heard about Synergy sooner. This app is so cool. If you have a laptop, and run MythTV, you'll wish you've been using it all along as well.

From Synergy's site:
---------------
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's intended for users with multiple computers on their desk since each system uses its own monitor(s).
---------------

I use Synergy to let me control my mythbox from my laptop. This is not the same as VNC. I don't see the mythtv desktop from my laptop. I'm still using my TV as a monitor, but using my laptop mouse and keyboard to control it. It's very handy for watching web videos on my tv through mythtv, or just to interface with myth a little faster than with my remote control. My mythtv box doesn't have a keyboard plugged into it anymore.

I have my system setup so that my laptop is the synergy server. The server is the machine that has the keyboard and mouse that you want to share. I created a simple script on my mythtv box that starts the synergy client when the mythtv user first logs in (through the session start-up scripts configuration) at ~/bin/synergy_client:

---------------
#!/bin/bash
synergyc --name mythtv [laptop ip address]
---------------

When I want to control my myth box with my laptop keyboard and mouse, i start up the synergy server on my laptop with a simple script named ~/bin/synergy_server:

---------------
#!/bin/bash
killall synergys
sleep 1
synergys --config /etc/synergy.config --name laptop
---------------

If both the server and client are running, I just move my mouse to the right edge of my laptop's screen, and it's now on the mythtv box. Any keyboard activity is sent to mythtv. The clipboard is shared between the two machines. If I want to confine myself to the current box I'm in, I just turn on Scroll Lock. This will prevent the mouse from moving outside the current context.

For reference, here's my laptop's synergy config file:

section: screens
laptop:
mythtv:
end

section: aliases
laptop:
[laptop's ip address goes here]
mythtv:
[mythtv's ip address goes here]
end

section: links
laptop:
right = mythtv
mythtv:
left = laptop
end

section: options
screenSaverSync = false
end

1 comment:

Chris said...

I tried doing this as well, but abandoned due to a focus issue. When mythtv (the synergy client) loses the mouse pointer (ie: I'm using it on my laptop), synergy forcibly removes the focus from MythTV. This makes normal button menus unusable because no button is selected, and the normal up/down/select won't work until the mouse focus is returned. Synergy needs a 'preserveMouseFocus' option for individual screens.