#!/bin/sh

# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")

# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")

# run the launcher without a sandbox, to avoid the SUID error
# https://github.com/electron/electron/issues/18265
if [ -n "$SteamAppId" ]; then
  # Also ensure to disable Wayland support due to Steam Linux Runtime issues
  "${SCRIPTPATH}"/Launcher --no-sandbox --ozone-platform=x11 "$@"
else
  "${SCRIPTPATH}"/Launcher --no-sandbox "$@"
fi
