Wednesday, 27 November 2013

Is there a DM-independent way to set XAUTHORITY in my Synergy upstart script?

I use synergy[1] so that I can use a single mouse and keyboard across two computers. While there are instructions for getting it to start automatically when eg. lightdm starts, this is prone to annoyances (eg. the lightdm login screen somehow forces synergy to use a single monitor boundary, you can't restart the service without restarting lightdm).

I had written an upstart conf file for 12.10[2] that allowed synergy to act as a service, and thus could restart on video configuration changes (or be restarted manually in the event of crashes). But I need to set XAUTHORITY somehow (and possibly DISPLAY, and maybe others...), and the only DM-independent way to do that was with some scripts that just happened to be sitting in /usr/share/acpi-support/power-funcs.

These are gone now (in 13.10), I think because they existed only to allow integration with ConsoleKit, and ConsoleKit has been replaced by logind.

So my question is: is there a way to get a sensible value for XAUTHORITY and DISPLAY in an upstart conf file that doesn't require special-casing every different display manager? Or, if not, is there a page somewhere that documents how the different display managers set these?