diff options
Diffstat (limited to 'build-helpers/detect_wayland.sh')
-rw-r--r-- | build-helpers/detect_wayland.sh | 16 |
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 | ||
2 | if [ ! -L "$0" ]; then | ||
3 | electron_dir="$(dirname "$0")" | ||
4 | else | ||
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 | ||
10 | fi | ||
11 | electron_path="${electron_dir}/{{REAL_BINARY_NAME}}" | ||
12 | if [ -n "${WAYLAND_DISPLAY+1}" ]; then | ||
13 | exec "${electron_path}" --enable-features=WaylandWindowDecorations,WebRTCPipeWireCapturer --ozone-platform=wayland "$@" | ||
14 | else | ||
15 | exec "${electron_path}" --ozone-platform=x11 "$@" | ||
16 | fi | ||