mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-30 05:42:46 -08:00
use XDG_RUNTIME_DIR for socket
This commit is contained in:
1 parent
5437f209f0
commit
be28de3703
2 files changed
+12
-3
No files matched your search
@@ -32,6 +32,7 @@ import solarxr_protocol.datatypes.TrackerIdT;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.Queue;
|
||||
import java.util.Timer;
|
||||
@@ -133,7 +134,7 @@ public class VRServer extends Thread {
|
||||
hmdTracker,
|
||||
"steamvr",
|
||||
"SteamVR Driver Bridge",
|
||||
"/tmp/SlimeVRDriver",
|
||||
Paths.get(OperatingSystem.getTempDirectory(), "SlimeVRDriver").toString(),
|
||||
shareTrackers
|
||||
);
|
||||
} catch (Exception ex) {
|
||||
|
||||
@@ -11,7 +11,7 @@ public enum OperatingSystem {
|
||||
OSX("osx", new String[]{"mac"}),
|
||||
UNKNOWN("unknown", new String[0]);
|
||||
//@fomatter: on
|
||||
|
||||
|
||||
private final String[] aliases;
|
||||
public final String name;
|
||||
private static OperatingSystem currentPlatform;
|
||||
@@ -44,4 +44,12 @@ public enum OperatingSystem {
|
||||
}
|
||||
return UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTempDirectory() {
|
||||
if(currentPlatform == LINUX) {
|
||||
String tmp = System.getenv("XDG_RUNTIME_DIR");
|
||||
if(tmp != null) return tmp;
|
||||
}
|
||||
return System.getProperty("java.io.tmpdir");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user