Synergy notes

From Helpful
Jump to: navigation, search
This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

Synergy allows you to use one keyboard+mouse (and clipboard text) on multiple computers (probably where you've put their monitors next to each other, otherwise it gets confusing).

It a client-server setup and not symmetric, in that only the server's mouse and keyboard can move to each client (while each client's mouse and keyboard, if connected at all, are isolated to it).


There are a few shortcomings, for example in that reaction time may be sluggish if the synergy server or client (process) is very busy, and depending on setup it may stop working when the server's screen is locked (though that can be called a security feature too).


You will have to create a layout where each monitor is relatively positioned to another: when you move the mouse off a monitor edge where you have virtually configured another computer/monitor to be, synergy routes your keyboard and mouse events to that computer.

People commonly have two monitors and want a simple left-right setup.


Configuration examples

aliases, screens

It is generally convenient to add aliases for the hosts involved, purely so you can read and edit the whole config faster. For example, let's say we have a windows and linux computer:

section: aliases
  linux:
     server.example.com
  windows:   
     home.example.com
end


screens defines which clients to use in a layout. At the least, you mention each host/alias:

section: screens
  linux:
    # per-client tweaking goes here
  windows:   
    #if you want any, that is.
end

Tweaking options include how caps lock and such should behave, how to translate the windows key to client screens, and some switching behaviour.

links (the layout)

Lets you declare what should happen at each (portion of an) edge. You'll usually want this to reflect how the screens are physically positioned, or you'll quickly get confused:)

basic example

For example, if you have two monitors side by side like:

+-------+-------+
|       |       |
|  lin  |  win  |
|       |       |
+-------+-------+

...and no wish to make things complex, you'll only want to switch to the other.

section: links   
  linux:
     right = windows 
  windows:   
     left  = linux
end


more complex examples

You can pull a few tricks. There's not even a need to be physically accurate, but it's usually less confusing that way.


Different types of monitor layouts can be useful to tweak more accurately. Imagine, for example, that you have two small monitors on top of a third, much larger one:

+-----+-----+
|     |     |
|  a  |  b  |
+-----+-----+
|           |
|     c     |
|           |
+-----------+

You can tell it to react to portions of an edge (in percents), and what portion of the target screen the cursor should appear in (also in percents). You'ld probably do something like:

section: links   
  a:
    right: b
    down:  c(0,50)
  b: 
    left:  a
    down:  c(50,100)     
  c:
    up(0,50): a
    up(0,50): b
end


You could also e.g. get three monitors arranged in a triangle:

    +-------+
    |       |
    | curly |
    |       |
+---+---+---+---+
|       |       |
|  moe  | larry |
|       |       |
+-------+-------+

This is the curly-moe-larry example you see around a lot.

section: links 
   moe: 
      right = larry 
      up(50,100) = curly(0,50) 
   larry: 
      left = moe 
      up(0,50) = curly(50,100) 
   curly: 
      down(0,50) = moe 
      down(50,100) = larry(0,50) 
end 

Note that there is one irregularity in this: the left half of the bottom of curly goes to all of (rather than the right side of) moe, so it'll skip to the left when you pass that edge. This is probably done for practical reasons - menu bars and such on moe are on the left, and you can get to that a little faster this way.

options

There are various options. Some of the useful ones include:


don't switch...

# ...unless mouse is near edge at least this amount of time
switchDelay = 200   #milliseconds
# ...unless you bump the mouse cursor into an edge twice within this time
switchDoubleTap = 500   #milliseconds
# ...when in a corner 
switchCorners = none
# ...of size (in pixels)
switchCornerSize = 125
# 
# corner names you can use: 
#  none, all, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right
# ...and combinations, like   
#  all -left +top-left

The corner thing can be interesting for mac users that have corners as hotspots for exposé and such.

Actions

You can react to mouse and keyboard events by sending them, or something else, to a particular screen, or all screens.

TODO: figure out good examples



Automatically (re)starting

This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)

If the synergy client disconnects without reconnecting, you'ld have to go into that client computer and restart it.

On linux, one way to work around this is to put something like the following in a script:

#!/bin/bash
while [ yes ]; do 
 #is there no synergyc process that is currently connected?
 test -n "`lsof -c synergyc | grep ESTABLISHED`"; shouldstart=$?
 # (you could add other tests, e.g. -i for a specific host or port)
 if [ "$shouldstart" = "1" ]; then
    echo "No synergyc running, starting."
    synergyc -1 -f --name myname synserver.example.com
 fi
 sleep 1
done

(It seems this is not foolproof, though, because I still occasionally have clients that, are running but unconnected, and need to be killed so that this script decides to run a new client)


Problems

If, in Ubuntu, the client seems to lag extremely, which seems due to a kernel scheduler detail/bug in beta versions of Ubuntu. It will be fixed in newer kernels, but currently the quick and dirty workaround seems to be running the client as root.

For more information, read:

See also

GUIs:

Manual configuration:


Related:

  • teleport, a similar but mac-only solution