aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/sclang17
1 files changed, 11 insertions, 6 deletions
diff --git a/bin/sclang b/bin/sclang
index 937ce94..e7da3a5 100755
--- a/bin/sclang
+++ b/bin/sclang
@@ -1,10 +1,15 @@
#!/bin/sh
-# If not running my laptop (with X screen), run sclang in a xvfb environment.
-# This ensures getting around a bug with QPixmaps that needs a X server to run.
-if [[ $HOSTNAME == *pitheunlord* ]]; then
- echo "/usr/bin/sclang in fake X screen"
- /usr/bin/xvfb-run -s "-screen 1, 1280x800x24" -a -e ~/.log/xvfb-run-sclang.error /usr/bin/sclang "$@"
+# 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
+# NOTE: For headless sclang to work properly changes to SCClassLibrary have to
+# 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
+ xvfb-run -a /usr/bin/sclang "$@"
else
- echo "/usr/bin/sclang"
/usr/bin/sclang "$@"
fi