forked from flathub/org.jitsi.jitsi-meet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jitsi-meet-run
executable file
·38 lines (33 loc) · 1.28 KB
/
jitsi-meet-run
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
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -euo pipefail
EXTRA_ARGS=()
# Borrowed from: https://github.com/flathub/md.obsidian.Obsidian/blob/5312e50f13f48efccd60a90f282b92b38bcec9a1/obsidian.sh#L20
# Wayland support can be optionally enabled like so:
# flatpak override --user --socket=wayland org.jitsi.org.jitsi.jitsi-meet
if [[ -e "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-"wayland-0"}" ]]; then
echo "Debug: Enabling Wayland backend"
EXTRA_ARGS+=(
--ozone-platform-hint=auto
--enable-features=WaylandWindowDecorations
)
if [[ -c /dev/nvidia0 ]]; then
echo "Debug: Detecting Nvidia GPU. disabling GPU sandbox."
EXTRA_ARGS+=(
--disable-gpu-sandbox
)
fi
fi
# Borrowed from: https://github.com/flathub/md.obsidian.Obsidian/blob/5312e50f13f48efccd60a90f282b92b38bcec9a1/obsidian.sh#L36
if [[ "${JITSI_CLEAN_CACHE:-0}" -eq 1 ]]; then
CACHE_DIRECTORIES=(
"${XDG_CONFIG_HOME}/Jitsi Meet/GPUCache"
)
for CACHE_DIRECTORY in "${CACHE_DIRECTORIES[@]}"; do
if [[ -d "${CACHE_DIRECTORY}" ]]; then
echo "Deleting cache directory: ${CACHE_DIRECTORY}"
rm -rf "${CACHE_DIRECTORY}"
fi
done
fi
export TMPDIR="${XDG_RUNTIME_DIR}/app/${FLATPAK_ID}"
exec zypak-wrapper /app/bin/jitsi-meet/jitsi-meet "${EXTRA_ARGS[@]}" "$@"