Synergy

Introduction
Synergy lets you use one keyboard and mouse across multiple computers across different Operating Systems. To do so it requires that all the computers are connected to each other via TCP/IP networking. Most systems come with this installed.

This tutorial follows the general layout of the the official installation procedure, but with Gentoo-specific commands.

Install
Install Synergy on every computer :

(Your computers do not have to run the same Operating System. The tutorial here shows how to do it in Gentoo, but you can mix your setup with any other flavour of Linux, Windows and MacOS)

Configure
Synergy is configured with a plain text file. A well-commented sample configuration is provided, just make sure to check it out. For any further documentation please refer to the official website (link in the See Also section).

Start the Server
The server is the computer that possess the keyboard and mouse you want to share across the others. Start the server on your main computer by doing the following as a normal user (not root) :

Possible parameters :
 * -a : Adresse(s) to listen for clients. (If omited, will listen to all);
 * -c : Specify a different configuration file;
 * --display : Connect to the XServer at ;
 * -f : Run server in foreground;
 * -n  : Identifies the screen by it's name instead of it's IP or Hostname;
 * -l : Do not try to restart the server if it fails;

Start the Client(s)
Launch the clients that will act as secondaries screens using this command as a normal user (not root) :

Changing hostnameoripofserver by the host name or the IP of the server.

Running in the background
If you omit the -f parameter used in the above steps, the program will run silently and return your console to shell while running. You should do this once your verified that everything is working fine and debugging potential errors with the -f parameter.

Setting up an init script
As root, create the following files : /etc/init.d/synergy and /etc/conf.d/synergy

In the file, write :

In the file, write:


 * Replace yourusername in the SYNERGY_USER variable by your username since Synergy should not be run as root;
 * Modify the SYNERGY_EXEC variable according to your needs: for the server or  for a client;
 * Modify the SYNERGY_OPTS variable according to your needs. Note that you should use the -a parameter for enhanced security. You should let the -f parameter on this variable, otherwise starting and stopping function might not work correctly.
 * You may wish to avoid using quotes in the SYNERGY_OPTS variable . --display ':0'  passes  ':0'  as an argument instead of just :0. A potential solution for those whom need quoting features (such as for a file with spaces) is to store the arguments in an array. (If anyone else finds this true for the init script, please remove the two single quotes from the SYNERGY_OPTS variable)
 * If you configure a client, make sure the IP or Hostname of the Synergy server is the last argument

Make the script executable :

Add the script to the default run level:

Troubleshooting
Lag synergy client: you can fix this problem launching synergy client as root. You have to allow xserver access to root:

Down and Left-Arrow Keys not repeating on client (gnome): You may want to take a look at this workaround described on https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/278078/comments/43: On the gnome-client execute the following command after synergyc has been started. Move the mouse-pointer to the synergy-server and back to the client after executing the command. This seems to "activate" the new settings.