Support "singleton" mode -- start xpra instance only if no other live instance exists
|Reported by:||krlmlr||Owned by:||krlmlr|
I would like to propose an enhancement to xpra:
--singleton switch to
xpra start that will result in a no-op if a live session exists (as seen by
xpra list). If this switch is given, xpra writes sourceable shell scripts to a predefined location (say,
.fish) that export the
DISPLAY variable to the value used by the singleton. (In anticiptation to a solution for #172...)
The purpose is to achieve a behavior similar to Gentoo's
keychain. This is a tool which ensures that an
ssh-agent is always available and accessible from the shell. There,
keychain is started from
.profile, ensures that one
ssh-agent is up and running and adds keys to that agent, possibly querying for a passphrase. This tool also creates sourceable shell scripts that contain proper values for
SSH_AUTH_SOCK -- these scripts are normally sourced from
.bashrc or the equivalent for the other shells.
If xpra had such a facility, one could finally seamlessly integrate xpra with screen, using pretty much the same approach as
keychain. Of course, it would be possible to implement this in an external script, and I'd be willing to do so. However, I think this feature is better suited within xpra itself.
http://stackoverflow.com/a/18041092/946850 for a more verbose description of
keychain in the context of using SSH keys with
http://krlmlr.github.io/2013/08/07/integrating-xpra-with-screen/ for an attempt to integrate xpra with screen -- works, but the solution proposed above would be better.