From 7c72317768e0c91330698910f8dc16adb07db512 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 18 Apr 2020 20:45:31 +0200 Subject: bin/sclang: Adding a forced export of DISPLAY. Fixing shebang to use bash and not posix shell. --- bin/sclang | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/sclang b/bin/sclang index e7da3a5..a97b5b6 100755 --- a/bin/sclang +++ b/bin/sclang @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # If not running X, run sclang in a xvfb environment. # This ensures getting around a bug with QPixmaps that needs a X server to run: # https://github.com/supercollider/supercollider/issues/1736 @@ -6,9 +6,12 @@ # be applied: https://github.com/supercollider/supercollider/issues/1209 set -euo pipefail -IFS=$'\n\t' -if [ -x /usr/bin/xset ] && [ ! /usr/bin/xset q &>/dev/null ];then +if [ -z "${DISPLAY:-}" ]; then + export DISPLAY=:0 +fi + +if command -v xset > /dev/null && xset q >/dev/null ; then xvfb-run -a /usr/bin/sclang "$@" else /usr/bin/sclang "$@" -- cgit v1.2.3-70-g09d2