Skip to content

Steam#1763

Open
HannahPadd wants to merge 111 commits intomainfrom
hannah/steam
Open

Steam#1763
HannahPadd wants to merge 111 commits intomainfrom
hannah/steam

Conversation

@HannahPadd
Copy link

@HannahPadd HannahPadd commented Feb 27, 2026

This pr contains changes needed for the steam release to run.
Changes include:

  • Server can send to the gui if drivers or udev rules aren't installed.
  • Server can attempt to install drivers.

This PR relies on this PR from solarXR SlimeVR/SolarXR-Protocol#198

Base automatically changed from llelievr/electron to main March 10, 2026 20:38
Comment on lines +41 to +53
val isPressureVessel = System.getenv("PRESSURE_VESSEL_RUNTIME")?.isNotEmpty()
val dir = if (isPressureVessel == true) {
val user = System.getenv("USER")
"/home/$user/.local/share/dev.slimevr.SlimeVR"
} else {
val runtimeDir = System.getenv("XDG_RUNTIME_DIR")
if (!runtimeDir.isNullOrBlank()) {
runtimeDir
} else {
System.getProperty("java.io.tmpdir")
}
}
return dir
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dir variable here is unnecessary, you can just have return statements in the branches

We also cannot assume data home is at /home/$USER/.local/share. See resolveLogDirectory on how to properly handle this

Comment on lines +387 to +397
const serverArgs = ['-Xmx128M', '-jar', serverJar]

const process = spawn(javaBin, ['-Xmx128M', '-jar', serverJar, 'run']);
if (options.steam) serverArgs.push(`--steam=${options.steam}`)
if (options.install) serverArgs.push(`--install=${options.install}`)
if (options.noUdev) serverArgs.push(`--no-udev`)

serverArgs.push('run')

const process = spawn(javaBin, serverArgs)

logger.info(`Java start command: ${serverArgs.join(' ')})`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const serverArgs = ['-Xmx128M', '-jar', serverJar]
const process = spawn(javaBin, ['-Xmx128M', '-jar', serverJar, 'run']);
if (options.steam) serverArgs.push(`--steam=${options.steam}`)
if (options.install) serverArgs.push(`--install=${options.install}`)
if (options.noUdev) serverArgs.push(`--no-udev`)
serverArgs.push('run')
const process = spawn(javaBin, serverArgs)
logger.info(`Java start command: ${serverArgs.join(' ')})`)
const serverArgs = ['-Xmx128M', '-jar', serverJar];
if (options.steam) serverArgs.push('--steam');
if (options.install) serverArgs.push('--install');
if (options.noUdev) serverArgs.push('--no-udev');
serverArgs.push('run');
logger.info({ serverArgs }, 'Server command-line arguments');
const process = spawn(javaBin, serverArgs);

val parser: CommandLineParser = DefaultParser()
val formatter = HelpFormatter()
val options = Options()
val isLinux = System.getProperty("os.name").lowercase().contains("linux")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val isLinux = System.getProperty("os.name").lowercase().contains("linux")
val isLinux = OperatingSystem.currentPlatform == OperatingSystem.LINUX

Comment on lines +38 to +51
val dir = System.getenv("SLIMEVR_SOCKET_DIR")
if (dir != null) return dir
if (currentPlatform == LINUX) {
dir = System.getenv("XDG_RUNTIME_DIR")
if (dir != null) return dir
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")
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the previous way of re-assigning to dir is more readable. There's also a missing return statement, and XDG_DATA_HOME is not being handled

Suggested change
val dir = System.getenv("SLIMEVR_SOCKET_DIR")
if (dir != null) return dir
if (currentPlatform == LINUX) {
dir = System.getenv("XDG_RUNTIME_DIR")
if (dir != null) return dir
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")
}
}
var dir = System.getenv("SLIMEVR_SOCKET_DIR")
if (dir != null) return dir
if (currentPlatform == LINUX) {
val isPressureVessel = System.getenv("PRESSURE_VESSEL_RUNTIME")?.isNotEmpty() == true
if (isPressureVessel) {
dir = System.getenv("XDG_DATA_HOME")?.let { Path(it, CONFIG_IDENTIFIER) }
?: System.getenv("HOME")?.let { Path(it, ".local", "share", CONFIG_IDENTIFIER) }
if (dir != null) return dir
}
dir = System.getenv("XDG_RUNTIME_DIR")
if (dir != null) return dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Application Protocol Related to communication with apps like the GUI, overlay, games Area: GUI Related to the GUI Area: Server Related to the server Area: SteamVR Driver Related to the SteamVR Driver Area: Translation Improvements or additions to translations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants