From a83c7ff31ec24ad574302ab54d0e9242fe141c16 Mon Sep 17 00:00:00 2001 From: HannahPadd Date: Mon, 16 Mar 2026 18:02:38 +0100 Subject: [PATCH] PR feedback --- gui/electron/main/index.ts | 4 ++-- .../java/io/eiren/util/OperatingSystem.kt | 22 +++++++++---------- .../src/main/java/dev/slimevr/desktop/Main.kt | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gui/electron/main/index.ts b/gui/electron/main/index.ts index 1aa3eb001..6baed78f7 100644 --- a/gui/electron/main/index.ts +++ b/gui/electron/main/index.ts @@ -386,8 +386,8 @@ const spawnServer = async () => { logger.info({ javaBin, serverJar }, 'Found Java and server jar'); const serverArgs = ['-Xmx128M', '-jar', serverJar] - if (options.steam) serverArgs.push(`--steam=${options.steam}`) - if (options.install) serverArgs.push(`--install=${options.install}`) + if (options.steam) serverArgs.push(`--steam`) + if (options.install) serverArgs.push(`--install`) if (options.noUdev) serverArgs.push(`--no-udev`) serverArgs.push('run') 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 921417f0c..ce923e5e4 100644 --- a/server/core/src/main/java/io/eiren/util/OperatingSystem.kt +++ b/server/core/src/main/java/io/eiren/util/OperatingSystem.kt @@ -1,5 +1,6 @@ package io.eiren.util +import dev.slimevr.SLIMEVR_IDENTIFIER import java.io.File import java.nio.file.Path import java.util.* @@ -35,20 +36,19 @@ enum class OperatingSystem( val socketDirectory: String get() { - val dir = System.getenv("SLIMEVR_SOCKET_DIR") + var dir = System.getenv("SLIMEVR_SOCKET_DIR") if (dir != null) return dir if (currentPlatform == LINUX) { - val isPressureVessel = System.getenv("PRESSURE_VESSEL_RUNTIME")?.isNotEmpty() - if (isPressureVessel == true) { - System.getenv("HOME")?.let { Path(it, ".local", "share", "dev.slimevr.SlimeVR") } - } else { - val runtimeDir = System.getenv("XDG_RUNTIME_DIR") - return if (!runtimeDir.isNullOrBlank()) { - runtimeDir - } else { - System.getProperty("java.io.tmpdir") - } + + val isPressureVessel = System.getenv("PRESSURE_VESSEL_RUNTIME")?.isNotEmpty() == true + if (isPressureVessel) { + dir = System.getenv("XDG_CONFIG_HOME")?.let { Path(it, SLIMEVR_IDENTIFIER + ).toString() } + ?: System.getenv("HOME")?.let { Path(it, ".local", "share", SLIMEVR_IDENTIFIER).toString() } + if (dir != null) return dir } + dir = System.getenv("XDG_RUNTIME_DIR") + if (dir != null) return dir } return System.getProperty("java.io.tmpdir") } diff --git a/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt b/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt index b5603e79f..f8d78050f 100644 --- a/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt +++ b/server/desktop/src/main/java/dev/slimevr/desktop/Main.kt @@ -54,7 +54,7 @@ fun main(args: Array) { val parser: CommandLineParser = DefaultParser() val formatter = HelpFormatter() val options = Options() - val isLinux = System.getProperty("os.name").lowercase().contains("linux") + val isLinux = OperatingSystem.currentPlatform == OperatingSystem.LINUX options.addOption("h", "help", false, "Show help") options.addOption("V", "version", false, "Show version") options.addOption("i", "install", true, "Run the driver install")