gavenkoa
gavenkoa

Reputation: 48753

How to choose DISPLAY value for X server programmatically?

I discover a way to run second X server on top of primary with one of:

$ xinit ~/.fvwm/xinit -- `command -v Xnest` :1
$ xinit ~/.fvwm/xinit -- `command -v Xephyr` :1

How can I find which DISPLAY (here is :1) is free for use programmatically?

Preferred is solution from command line.

What limits for DISPALY value count (hardware/software)?

Upvotes: 0

Views: 536

Answers (1)

Andrey Sidorov
Andrey Sidorov

Reputation: 25456

same limits as for port number ( it's 6000 + display if server is listening on TCP ). Try to bind to a port, if successful - consider it's free, release and start X server with DISPLAY= (port - 6000)

Upvotes: 1

Related Questions