aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/src/nxmhandler_linux.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/src/nxmhandler_linux.cpp b/src/src/nxmhandler_linux.cpp
index 1203585..3e18658 100644
--- a/src/src/nxmhandler_linux.cpp
+++ b/src/src/nxmhandler_linux.cpp
@@ -196,7 +196,16 @@ void NxmHandlerLinux::registerHandler() const
}
const QString wrapperPath = localBin + "/mo2-nxm-handler";
- const QString executable = QCoreApplication::applicationFilePath();
+
+ // Determine a stable executable path for the wrapper script.
+ // QCoreApplication::applicationFilePath() returns the temp FUSE mount for
+ // AppImages (/tmp/.mount_XXXXX/...) which changes every launch. Use the
+ // APPIMAGE env var (the actual .AppImage file) when available.
+ QString executable = qEnvironmentVariable("APPIMAGE");
+ if (executable.isEmpty()) {
+ executable = QCoreApplication::applicationFilePath();
+ }
+
const QString wrapper =
QString("#!/bin/sh\nexec \"%1\" nxm-handle \"$@\"\n").arg(executable);