forked from flathub/org.signal.Signal
/
signal-desktop.sh
43 lines (34 loc) · 1.07 KB
/
signal-desktop.sh
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
39
40
41
42
43
#!/bin/bash
EXTRA_ARGS=()
declare -i SIGNAL_USE_TRAY_ICON="${SIGNAL_USE_TRAY_ICON:-0}"
declare -i SIGNAL_START_IN_TRAY="${SIGNAL_START_IN_TRAY:-0}"
declare -i SIGNAL_DISABLE_GPU="${SIGNAL_DISABLE_GPU:-0}"
declare -i SIGNAL_DISABLE_GPU_SANDBOX="${SIGNAL_DISABLE_GPU_SANDBOX:-0}"
# Additional args for tray icon
if [[ "${SIGNAL_USE_TRAY_ICON}" -eq 1 ]]; then
EXTRA_ARGS+=(
"--use-tray-icon"
)
fi
if [[ "${SIGNAL_START_IN_TRAY}" -eq 1 ]]; then
EXTRA_ARGS+=(
"--start-in-tray"
)
fi
if (( ${SIGNAL_USE_WAYLAND:-0} )); then
export ELECTRON_OZONE_PLATFORM_HINT="${ELECTRON_OZONE_PLATFORM_HINT:-auto}"
fi
if [[ "${SIGNAL_DISABLE_GPU}" -eq 1 ]]; then
EXTRA_ARGS+=(
"--disable-gpu"
)
fi
if [[ "${SIGNAL_DISABLE_GPU_SANDBOX}" -eq 1 ]]; then
EXTRA_ARGS+=(
"--disable-gpu-sandbox"
)
fi
echo "Debug: Will run signal with the following arguments:" "${EXTRA_ARGS[@]}"
echo "Debug: Additionally, user gave: $*"
export TMPDIR="${XDG_RUNTIME_DIR}/app/${FLATPAK_ID}"
exec zypak-wrapper /app/Signal/signal-desktop "${EXTRA_ARGS[@]}" "$@"