Skip to content

Start Synergy Automatically (Ubuntu 12.04)

Starting Synergy Automatically on Ubuntu 12.04

One of the things that greatly annoyed me every time I had to log onto my Linux box was first logging onto the console and then starting quicksynergy to capture my keyboard and mouse from another computer. I’m not sure exactly how long I’ve been putting up with this but it ended yesterday!

Since Ubuntu uses lightdm for it’s display manager (they switched from gdm to lightdm when Ubuntu 11.10 came out I think, but I may be wrong on that). If you are using another display manager (gdm, kde, xdm), then this will not work and you will have to consult the Ubuntu wiki at https://help.ubuntu.com/community/SynergyHowto. If you have already tried to start synergy automatically using other methods or tried to alter other display managers (e.g. you upgraded from 11.04 or earlier), you may have to remove those customizations before performing these steps as they may interfere with the process.

Also note that this method requires administrative privileges.

Without further adieu, here’s how I did it:

For Synergy Server

1.  Create the directory /etc/synergy

2. Create a synergy configuration file

/etc/synergy/synergy.conf:

section: screens
bugs:
daffy:
end
section: links
bugs:
right = daffy
daffy:
left = bugs
end

Or if you already have a configuration file from quicksynergy just copy the file

sudo cp ~/.quicksynergy/synergy.conf /etc/synergy

3. Create a start up script

/etc/synergy/startsynergys:

#!/bin/bash
/usr/bin/synergys -c /etc/synergy/synergy.conf -n bugs

4. Make the script executable

sudo chmod 755 /etc/synergy/startsynergys

5. Add the following line to /etc/lightdm/lightdm.conf

greeter-setup-script=/etc/synergy/startsynergys

6. Restart the computer (or the lightdm service)

For Synergy Client

1.  Create the directory /etc/synergy

2. Create a start up script

/etc/synergy/startsynergyc

#!/bin/bash
/usr/bin/synergyc -n daffy <hostname/IP of server goes here>

3. Make the script executeable

sudo chmod 755 /etc/synergy/startsynergyc

4. Add the following line to /etc/lightdm/lightdm.conf

greeter-setup-script=/etc/synergy/startsynergyc

5. Restart the computer (or the lightdm service)

Tags: