Skip to content

Commit

Permalink
XDG_DATA_DIR doesnt exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ImUrX authored Sep 24, 2024
1 parent a3e54b4 commit 4983b03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bridge/bridge-unix-sockets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <filesystem>

#define TMP_DIR "/tmp"
#define XDG_DATA_DIR_DEFAULT ".local/share"
#define XDG_DATA_HOME_DEFAULT ".local/share"
#define SLIMEVR_DATA_DIR "dev.slimevr.SlimeVR"
#define SOCKET_NAME "SlimeVRDriver"

Expand Down Expand Up @@ -169,7 +169,7 @@ 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("XDG_DATA_DIR")) {
if (const char* ptr = std::getenv("XDG_DATA_HOME")) {
const fs::path data_dir = ptr;
socket = (data_dir / SLIMEVR_DATA_DIR / SOCKET_NAME);
} else if (const char* ptr = std::getenv("HOME")) {
Expand Down

0 comments on commit 4983b03

Please sign in to comment.