The goal is to launch Xephyr in a script. The most popular approach is this:Xephyr :4 &sleep 1  # or sleep 2launch_your_program_hereLet's see what happens here. First, unfortunately, Xephyr cannot daemonize itself, so we have to launch it asynchonously (&). Then we don't know when it's initialized, so we give it 1-2 seconds to initialize. This feels hacky. How to do it faster and more reliably?
How to launch `Xephyr` without `sleep`-ing
xorg;xephyr