On multi-user systems is would help a lot, if Xpra could find a free display number automatically.
Recent X servers as of version 1.13 (Xvfb, too) support the -displayfd <fd> command line option: It will make the X server choose the display itself and write the display number back to the file descriptor <fd>.
exec 6>display.log Xvfb -displayfd 6
xpra has supported this feature for years, see #172
Just use:
xpra start
Thanks! - It seams, that I missed a great feature of Xpra.
Why should one ever wants to set the display id manually?
Shouldn't this be the default way to use Xpra?
Can Xpra report the display number to stdout, if it was automatically chosen?
(eg. "Actual display id is now: localhost:28")
How would you recommend to get the automatically chosen display number if it is needed in a wrapper script? Is there any smarter way in Xpra than something like this:
xpra start --start-child=xterm 2>&1 > /dev/null | grep "Actual log file name is now" | sed 's#.*:##g' | sed 's#.log##g'
Why should one ever wants to set the display id manually?
When starting xpra from external management scripts I guess.
Shouldn't this be the default way to use Xpra?
It is!
Can Xpra report the display number to stdout, if it was automatically chosen?
Do you mean like this: r14822?
How would you recommend to get the automatically chosen display number if it is needed in a wrapper script? Is there any smarter way in Xpra than something like this: ...
I don't know, sorry.
Using grep and sed can be brittle.
I guess we could add our own "--displayfd" switch. This could be a bit tricky to implement since we normally daemonize and close all file descriptors before we know the display number.. (except stdout / stderr which are kept for the messages that you saw - that's already a special case)
Replying to Antoine Martin:
Shouldn't this be the default way to use Xpra?
It is!
Sorry ... www.xpra.org (Get started with Xpra) and the Wiki made me think, this not mend to be the default usage of Xpra. My fault.
Can Xpra report the display number to stdout, if it was automatically chosen?
Do you mean like this: r14822?
Yes ... great!!
How would you recommend to get the automatically chosen display number if it is needed in a wrapper script? Is there any smarter way in Xpra than something like this: ...
I don't know, sorry. Using grep and sed can be brittle. I guess we could add our own "--displayfd" switch. This could be a bit tricky to implement since we normally daemonize and close all file descriptors before we know the display number.. (except stdout / stderr which are kept for the messages that you saw - that's already a special case)
Yes ... great!!
I tested r14822 and it is just doing, what I was looking for. Thanks.
Can you add this feature to the 1.0.x branch, too?
It's been scheduled: wiki/Versions/PendingFixes
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1417