summaryrefslogtreecommitdiff
path: root/meshmc/launcher/MeshMC.in
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:45:07 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:45:07 +0300
commit31b9a8949ed0a288143e23bf739f2eb64fdc63be (patch)
tree8a984fa143c38fccad461a77792d6864f3e82cd3 /meshmc/launcher/MeshMC.in
parent934382c8a1ce738589dee9ee0f14e1cec812770e (diff)
parentfad6a1066616b69d7f5fef01178efdf014c59537 (diff)
downloadProject-Tick-31b9a8949ed0a288143e23bf739f2eb64fdc63be.tar.gz
Project-Tick-31b9a8949ed0a288143e23bf739f2eb64fdc63be.zip
Add 'meshmc/' from commit 'fad6a1066616b69d7f5fef01178efdf014c59537'
git-subtree-dir: meshmc git-subtree-mainline: 934382c8a1ce738589dee9ee0f14e1cec812770e git-subtree-split: fad6a1066616b69d7f5fef01178efdf014c59537
Diffstat (limited to 'meshmc/launcher/MeshMC.in')
-rwxr-xr-xmeshmc/launcher/MeshMC.in44
1 files changed, 44 insertions, 0 deletions
diff --git a/meshmc/launcher/MeshMC.in b/meshmc/launcher/MeshMC.in
new file mode 100755
index 0000000000..921b6162d8
--- /dev/null
+++ b/meshmc/launcher/MeshMC.in
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+# SPDX-FileCopyrightText: 2026 Project Tick
+# SPDX-FileContributor: Project Tick
+# SPDX-License-Identifier: GPL-3.0-or-later
+# 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=@MeshMC_AppBinaryName@
+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_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 "${LAUNCHER_DIR}/portable.txt" ]; then
+ ARGS+=("-d" "${LAUNCHER_DIR}")
+fi
+
+ARGS+=("$@")
+
+# Run the launcher
+exec -a "${ARGS[@]}"