Files
PrismLauncher/launcher/Launcher.in
DioEgizio bf42cfdcf2 fix: rename LAUNCHER_DISABLE_GLVULKAN to PRISMLAUNCHER_DISABLE_GLVULKAN
for consistency with other env vars

this also introduces LAUNCHER_ENVNAME in BuildConfig/program_info for rebranded configurations

Signed-off-by: DioEgizio <dioegizio@protonmail.com>
2026-03-26 18:33:44 +01:00

43 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Basic start script for running the launcher with the libs packaged with it.
function printerror {
printf "$1"
if which zenity >/dev/null; then zenity --error --text="$1" &>/dev/null;
elif which kdialog >/dev/null; then kdialog --error "$1" &>/dev/null;
fi
}
if [[ $EUID -eq 0 ]]; then
printerror "This program should not be run using sudo or as the root user!\n"
exit 1
fi
LAUNCHER_NAME=@Launcher_APP_BINARY_NAME@
LAUNCHER_ENVNAME=@Launcher_ENVName@
LAUNCHER_DIR="$(dirname "$(readlink -f "$0")")"
echo "Launcher Dir: ${LAUNCHER_DIR}"
# Makes the launcher use portals for file picking
export QT_QPA_PLATFORMTHEME=xdgdesktopportal
# disable OpenGL and Vulkan launcher features on sharun until https://github.com/VHSgunzo/sharun/issues/35
if [[ -f "${LAUNCHER_DIR}/sharun" ]]; then
export ${LAUNCHER_ENVNAME}_DISABLE_GLVULKAN=1
fi
# Just to be sure...
chmod +x "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}"
ARGS=("${LAUNCHER_DIR}/${LAUNCHER_NAME}" "${LAUNCHER_DIR}/bin/${LAUNCHER_NAME}")
if [ -f portable.txt ]; then
ARGS+=("-d" "${LAUNCHER_DIR}")
fi
ARGS+=("$@")
# Run the launcher
exec -a "${ARGS[@]}"