File size: 950 Bytes
e33425b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash
# Friction launcher (Desktop entry, xterm, supervisor all go through here).
# * LIBGL_ALWAYS_SOFTWARE=1: Skia on llvmpipe is the only GL in the sandbox.
# * A per-user PulseAudio with a null sink: Qt Multimedia's pulse plugin is
#   the only audio backend in the bundle, and Friction's audio handler throws
#   a modal "Critical Error … Unsupported sample format 0" on launch when no
#   server answers. Root is fine for a private, dummy server.
# * qt.conf resolves plugins/libs relative to bin/, so exec the real binary.
export LIBGL_ALWAYS_SOFTWARE=1
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp/runtime-$(id -u)}"
mkdir -p "$XDG_RUNTIME_DIR" && chmod 700 "$XDG_RUNTIME_DIR"
if command -v pulseaudio >/dev/null && ! pgrep -x pulseaudio >/dev/null; then
  pulseaudio --daemonize=yes --exit-idle-time=-1 --disallow-exit \
    --load="module-null-sink sink_name=dummy" >/dev/null 2>&1 || true
fi
exec /opt/friction/bin/friction "$@"