diff --git a/server/core/src/main/java/io/eiren/util/OperatingSystem.kt b/server/core/src/main/java/io/eiren/util/OperatingSystem.kt index 8a651e95e9..17b21299cf 100644 --- a/server/core/src/main/java/io/eiren/util/OperatingSystem.kt +++ b/server/core/src/main/java/io/eiren/util/OperatingSystem.kt @@ -39,6 +39,12 @@ enum class OperatingSystem( if (dir != null) return dir if (currentPlatform == LINUX) { dir = System.getenv("XDG_RUNTIME_DIR") + + // add /app/$FLATPAK_ID if running in flatpak + // see https://docs.flatpak.org/en/latest/sandbox-permissions.html + val flatpak_id = System.getenv("FLATPAK_ID") + if (flatpak_id != null) dir += "/app/" + flatpak_id + if (dir != null) return dir } return System.getProperty("java.io.tmpdir")