I'm trying to get Synergy, which is a keyboard and mouse sharing tool, to autostart on a second desktop. I'm using the distro BunsenLabs which is based on Debian Jessie on both desktops, and so I have LightDM as displaymanager and Openbox as windowmanager.
The computer which has the keyboard+mouse physically attached is called the server and runs synergys. The computer controlled by the virtual keyboard+mouse is called client and runs synergyc
So, on the client I added the following line just below [SeatDefaults] to /etc/lightdm/lightdm.conf :
greeter-setup-script=/usr/bin/synergyc 192.168.0.10
I also added this line to ~/.config/openbox/autostart :
/usr/bin/synergyc 192.168.0.10
When I boot everything works as it should; I can use the keyboard+mouse from my primary desktop on my secondary desktop and log in. After logging in Synergy continues to work properly. It's just when I lock my screen or wake up from hibernate/sleep, synergyc isn't working any more.
The forums and blogs I've read all suggest the above two lines should be everything needed to have synergyc running at all times, so I wouldn't need an extra keyboard just to log in.
Update -Solved:
When I'm logged in and look at the running processes I see synergyc running 6 times, 3x as root and 3x as MyUsername. When I lock my screen, 3 additional synergyc processes running as root appear. When I unlock again (using a 2nd keyboard, synergy is not responding at this time) the 3 additional processes close and synergy starts working again.
I've put this script in my lightdm.conf:
#!/bin/bash -x
/usr/bin/pkill -u root synergyc
while [ $(pgrep -u root -x synergys) ]; do sleep 0.1; done
/usr/bin/synergyc 192.168.xx.xxx
Now everything works and I can remove my 2nd keyboard+mouse. It's just that the mouse pointer jumps back to the primary screen of my synergy server when logging in/out or locking screen on the client...