Thursday, April 24, 2008

One mouse and keyboard to rule them all

If you have several boxes sitting at your desk and do not want to use one keyboard and mouse for each of them, you could install and setup Synergy software. It's a freeware and works great ! it's a client server architecture that communicates through IP. A daemon (synergys note the s for server) runs on the machine that has the keyboard and mouse and listen for clients. The client (synergyc note the c for client) connects to it.

The configuration is VERY easy. Take a look at my config file :




















Section:screens

Laptop:

Desktop:
End

Section:links

Laptop:


right = Desktop

Desktop:


left = Laptop
End

Section:aliases

Laptop:


laptoprealname

Desktop:


desktoprealname
End

Section:options

switchDelay=1
End




Now, few explanations about that config file. In the screen section, you list all your systems and call them by a convenient name. I used laptop and desktop but you can use whatever suits your environment.
The links section describes how your screen are physically setup.
The aliases section is here to translate the convenient machine names you choose to real name or ip. In my case the file /etc/hosts contains entries for laptoprealname and desktoprealhostname.
The switchDelay in the last section set the number of ms to wait when the mouse reaches a screen edge before it crosses over next screen. I put 1 there meaning there will be almost no wait.

Now, how do you start all these.... For the server, you run synergys -f. It should read the config file in $HOME/.synergy.conf.
Then, on the client, you run synergyc -f -1 .

You should now be able to use only one mouse and keyboard to control your machines.