| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | bindir=$(dirnamescip-shell system . . dirname. "$0") |
| 4 | |
| 5 | if [scip-shell system . . `[`. "${bindir}" != "" ]; then bindir="${bindir}/"; fi |
| 6 | |
| 7 | unset WAYLAND_DISPLAY |
| 8 | port=0 |
| 9 | while [scip-shell system . . `[`. -e "${XDG_RUNTIME_DIR}/wayland-${port}" ]; do |
| 10 | let port+=1 |
| 11 | done |
| 12 | wayland_display=wayland-${port} |
| 13 | |
| 14 | WAYLAND_DISPLAY=${wayland_display} MIR_SERVER_DISPLAY_AUTOSCALE=1200 "${bindir}"miriway-run-shell& |
| 15 | miriway_pid=$! |
| 16 | |
| 17 | # Wait until the server starts |
| 18 | until [scip-shell system . . `[`. -O "${XDG_RUNTIME_DIR}/${wayland_display}" ] |
| 19 | do |
| 20 | if ! killscip-shell system . . kill. -0 ${miriway_pid} &> /dev/nullscip-shell filesystem . . `/dev/null`. |
| 21 | then |
| 22 | echoscip-shell system . . echo. "ERROR: miriway-run-shell [pid=${miriway_pid}] is not running" |
| 23 | exit 1 |
| 24 | fi |
| 25 | inotifywait -qq --timeout 5 --event create "$(dirnamescip-shell system . . dirname. "${XDG_RUNTIME_DIR}/${wayland_display}")" |
| 26 | done |
| 27 | |
| 28 | XDG_SESSION_TYPE=mir GDK_BACKEND=wayland,x11 QT_QPA_PLATFORM=wayland SDL_VIDEODRIVER=wayland WAYLAND_DISPLAY=${wayland_display} NO_AT_BRIDGE=1 "$@" |
| 29 | killscip-shell system . . kill. $miriway_pid |