aboutsummaryrefslogtreecommitdiffstats
path: root/bin/sclang
blob: a97b5b672cdc90b4629966d16ec33ee72c20771a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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
# NOTE: For headless sclang to work properly changes to SCClassLibrary have to
# be applied: https://github.com/supercollider/supercollider/issues/1209

set -euo pipefail

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 "$@"
fi