Files
OneCAD-Draft/snap/local/open-cad-studio-wrapper
Hakan Seven 6df23ad8c2 fix(snap): handle desktop runtime paths
Strict confinement uses a private runtime directory while the Wayland socket remains in the host directory. Resolve the accessible socket path, provide bundled XKB data, and fall back to X11 only when needed.
2026-08-16 09:13:18 +03:00

22 lines
631 B
Bash

#!/bin/sh
export XKB_CONFIG_ROOT="$SNAP/usr/share/X11/xkb"
if [ -n "${WAYLAND_DISPLAY:-}" ]; then
case "$WAYLAND_DISPLAY" in
/*) wayland_socket="$WAYLAND_DISPLAY" ;;
*)
wayland_socket="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"
host_socket="${XDG_RUNTIME_DIR%/*}/$WAYLAND_DISPLAY"
if [ ! -S "$wayland_socket" ] && [ -S "$host_socket" ]; then
WAYLAND_DISPLAY="$host_socket"
export WAYLAND_DISPLAY
wayland_socket="$host_socket"
fi
;;
esac
[ -S "$wayland_socket" ] || unset WAYLAND_DISPLAY
fi
exec "$@"