Skip to content

Commit

Permalink
Update src/bridge/bridge-unix-sockets.cpp
Browse files Browse the repository at this point in the history
Co-authored-by: Kitlith <[email protected]>
  • Loading branch information
ImUrX and kitlith authored Feb 6, 2024
1 parent 7509236 commit 3486504
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bridge/bridge-unix-sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ BridgeStatus runBridgeFrame(SlimeVRDriver::VRDriver& driver) {
}
// try using home dir if the vrserver is run in a chroot like
if(!fs::exists(socket)) {
if(const char* ptr = std::getenv("HOME")) {
if (const char* ptr = std::getenv("XDG_DATA_DIR")) {
const fs::path data_dir = ptr;
socket = (ptr / SLIMEVR_DATA_DIR / SOCKET_NAME);
} else if (const char* ptr = std::getenv("HOME")) {
const fs::path home = ptr;
socket = (home / SLIMEVR_HOME_LOCAL_DIR / SOCKET_NAME);
socket = (home / XDG_DATA_DIR_DEFAULT / SLIMEVR_DATA_DIR / SOCKET_NAME);
}
}
if(fs::exists(socket)) {
Expand Down

0 comments on commit 3486504

Please sign in to comment.