diff options
author | David Runge <dave@sleepmap.de> | 2020-04-18 20:45:31 +0200 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2020-04-18 20:45:31 +0200 |
commit | 7c72317768e0c91330698910f8dc16adb07db512 (patch) | |
tree | 8d358cfe4358078b1f1bf9dcbfb8d59b70f75c23 | |
parent | 537d54c79e14e3eb40ed1b71123b0c81bb0b8c46 (diff) | |
download | dotfiles-7c72317768e0c91330698910f8dc16adb07db512.tar.gz dotfiles-7c72317768e0c91330698910f8dc16adb07db512.tar.bz2 dotfiles-7c72317768e0c91330698910f8dc16adb07db512.tar.xz dotfiles-7c72317768e0c91330698910f8dc16adb07db512.zip |
bin/sclang: Adding a forced export of DISPLAY. Fixing shebang to use bash and not posix shell.
-rwxr-xr-x | bin/sclang | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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 "$@" |