aboutsummaryrefslogtreecommitdiffstats
path: root/build-helpers/detect_wayland.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build-helpers/detect_wayland.sh')
-rw-r--r--build-helpers/detect_wayland.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/build-helpers/detect_wayland.sh b/build-helpers/detect_wayland.sh
new file mode 100644
index 0000000..e82a383
--- /dev/null
+++ b/build-helpers/detect_wayland.sh
@@ -0,0 +1,16 @@
1#!/usr/bin/env sh
2if [ ! -L "$0" ]; then
3 electron_dir="$(dirname "$0")"
4else
5 if command -v readlink >/dev/null; then
6 electron_dir="$(dirname "$(readlink -f "$0")")"
7 else
8 electron_dir="/opt/{{PRODUCT_NAME}}"
9 fi
10fi
11electron_path="${electron_dir}/{{REAL_BINARY_NAME}}"
12if [ -n "${WAYLAND_DISPLAY+1}" ]; then
13 exec "${electron_path}" --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --ozone-platform=wayland "$@"
14else
15 exec "${electron_path}" --ozone-platform=x11 "$@"
16fi