summarylogtreecommitdiffstats
path: root/stremio.sh
blob: a7c821212524b4d33dd5ac7e916e57534a3a0548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
export SERVER_PATH=/usr/share/stremio/server.js
# For MPV to work alongside GTK: https://github.com/Stremio/stremio-linux-shell/commit/3ce00e2291ed96ca01951a6a050ac2934736bb23
export LC_NUMERIC=C
# Video acceleration with Vulkan for Intel: https://github.com/Stremio/stremio-linux-shell/commit/cacc1249da045fa6a1d30d3d15049855ecb3e08a
export ANV_DEBUG="video-decode,video-encode"

# https://github.com/Stremio/stremio-linux-shell/blob/main/data/stremio.sh
# Use GSK OpenGL renderer for Nvidia cards
VENDOR=$(glxinfo | grep "OpenGL vendor string:" | sed 's/.*: //')
RENDERER=$(glxinfo | grep "OpenGL renderer string:" | sed 's/.*: //')
if echo "$VENDOR $RENDERER" | grep -qi "NVIDIA"; then
    export GSK_RENDERER=opengl
fi

# Use the systems self-hosted stremio-web if available
if command -v stremio-web >/dev/null 2>&1; then
    /usr/bin/stremio-web &
    STREMIO_WEB_PID=$!
    URL_ARG="--url http://localhost:8080"
fi

/usr/lib/stremio/stremio $URL_ARG "$@"

if [ -n "$STREMIO_WEB_PID" ]; then
    kill $STREMIO_WEB_PID
fi