setup_xvfb.sh 403 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. # Sets up a virtual display for running map renderer and simulator without an X11 display
  3. DISP_ID=99
  4. export DISPLAY=:$DISP_ID
  5. sudo Xvfb $DISPLAY -screen 0 2160x1080x24 2>/dev/null &
  6. # check for x11 socket for the specified display ID
  7. while [ ! -S /tmp/.X11-unix/X$DISP_ID ]
  8. do
  9. echo "Waiting for Xvfb..."
  10. sleep 1
  11. done
  12. touch ~/.Xauthority
  13. export XDG_SESSION_TYPE="x11"
  14. xset -q