Files
UNITRONIX 1fe504346e feat(rdclient): introduce RdClient desktop MVP with session handling and TLS support
- Added a new Tauri v2 operator shell for RdClient desktop, featuring first-run panel URL setup and session management.
- Implemented automatic session detection for Linux and TLS support for both HTTP and HTTPS with various certificate options.
- Enhanced remote session opening functionality to utilize the new desktop client when available.
2026-06-14 19:31:24 +02:00

51 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# BetterDesk RdClient — Linux launcher (X11 + Wayland).
# Applies the same WebKit/GDK workarounds as the Rust startup hook, then execs the binary.
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$HERE/.." && pwd)"
BIN="${RDCLIENT_DESKTOP_BIN:-$ROOT/src-tauri/target/debug/rdclient-desktop}"
if [ ! -x "$BIN" ]; then
BIN="$ROOT/src-tauri/target/release/rdclient-desktop"
fi
if [ ! -x "$BIN" ]; then
echo "rdclient-desktop: binary not found (run npm run build first)" >&2
exit 1
fi
export BETTERDESK_LAUNCHED_VIA_SCRIPT=1
# Respect explicit operator overrides; otherwise mirror linux_display.rs defaults.
if [ -z "${GDK_BACKEND:-}" ]; then
case "${BETTERDESK_UI_BACKEND:-}" in
x11|x) export GDK_BACKEND=x11 ;;
wayland|wl) export GDK_BACKEND=wayland ;;
*)
if [ -n "${WAYLAND_DISPLAY:-}" ] || [ "${XDG_SESSION_TYPE:-}" = wayland ]; then
export GDK_BACKEND=wayland,x11
elif [ -n "${DISPLAY:-}" ]; then
export GDK_BACKEND=x11
fi
;;
esac
fi
if [ -z "${BETTERDESK_WEBKIT_NO_WORKAROUND:-}" ]; then
if [ -f /proc/driver/nvidia/version ]; then
export __NV_DISABLE_EXPLICIT_SYNC="${__NV_DISABLE_EXPLICIT_SYNC:-1}"
export __GL_THREADED_OPTIMIZATIONS="${__GL_THREADED_OPTIMIZATIONS:-0}"
fi
if [ -n "${BETTERDESK_WEBKIT_DISABLE_DMABUF:-}" ] || [ -n "${BETTERDESK_WEBKIT_SAFE:-}" ]; then
export WEBKIT_DISABLE_DMABUF_RENDERER="${WEBKIT_DISABLE_DMABUF_RENDERER:-1}"
elif [ -n "${WAYLAND_DISPLAY:-}" ] || [ "${XDG_SESSION_TYPE:-}" = wayland ] \
|| [ "${BETTERDESK_UI_BACKEND:-}" = wayland ] || [ "${BETTERDESK_UI_BACKEND:-}" = wl ]; then
export WEBKIT_DISABLE_DMABUF_RENDERER="${WEBKIT_DISABLE_DMABUF_RENDERER:-1}"
fi
fi
exec "$BIN" "$@"