Skip to content

Commit

Permalink
allow to set the socket dir via SLIMEVR_SOCKET_DIR
Browse files Browse the repository at this point in the history
this is needed if the vrserver is running in a chroot env and we need to mount the sockets to the HOME dir.

see: SlimeVR/SlimeVR-OpenVR-Driver#43
  • Loading branch information
Links2004 committed Dec 13, 2023
1 parent c3c7fc8 commit e9f07f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions server/core/src/main/java/io/eiren/util/OperatingSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ enum class OperatingSystem(
}
}

val tempDirectory: String
val socketDirectory: String
get() {
var dir = System.getenv("SLIMEVR_SOCKET_DIR")
if (dir != null) return dir
if (currentPlatform == LINUX) {
val tmp = System.getenv("XDG_RUNTIME_DIR")
if (tmp != null) return tmp
dir = System.getenv("XDG_RUNTIME_DIR")
if (dir != null) return dir
}
return System.getProperty("java.io.tmpdir")
}
Expand Down
4 changes: 2 additions & 2 deletions server/desktop/src/main/java/dev/slimevr/desktop/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fun provideSteamVRBridge(
server,
"steamvr",
"SteamVR Driver Bridge",
Paths.get(OperatingSystem.tempDirectory, "SlimeVRDriver")
Paths.get(OperatingSystem.socketDirectory, "SlimeVRDriver")
.toString(),
computedTrackers
)
Expand Down Expand Up @@ -214,7 +214,7 @@ fun provideFeederBridge(
server,
"steamvr_feeder",
"SteamVR Feeder Bridge",
Paths.get(OperatingSystem.tempDirectory, "SlimeVRInput")
Paths.get(OperatingSystem.socketDirectory, "SlimeVRInput")
.toString(),
FastList()
)
Expand Down

0 comments on commit e9f07f9

Please sign in to comment.