From 9be5440d887a44cf71ba2771691b11b9774fdccd Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 13 Aug 2024 16:51:25 +0200 Subject: [PATCH] Add instructions for Steam on start --- server/active_runtime.cpp | 2 +- server/active_runtime.h | 2 ++ server/main.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/server/active_runtime.cpp b/server/active_runtime.cpp index b83bee14..e4f3d776 100644 --- a/server/active_runtime.cpp +++ b/server/active_runtime.cpp @@ -24,7 +24,7 @@ #include #include -static std::filesystem::path manifest_path() +std::filesystem::path active_runtime::manifest_path() { const std::filesystem::path install_location = "share/openxr/1/openxr_wivrn.json"; // Check if in a flatpak diff --git a/server/active_runtime.h b/server/active_runtime.h index 04b408b9..3d217c75 100644 --- a/server/active_runtime.h +++ b/server/active_runtime.h @@ -32,4 +32,6 @@ public: active_runtime(const active_runtime &) = delete; active_runtime & operator=(const active_runtime &) = delete; ~active_runtime(); + + static std::filesystem::path manifest_path(); }; diff --git a/server/main.cpp b/server/main.cpp index 883ac9af..23d462c8 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -126,6 +126,13 @@ void waitpid_verbose(pid_t pid, const std::string & name) int inner_main(int argc, char * argv[], bool use_systemd) { std::cerr << "WiVRn " << xrt::drivers::wivrn::git_version << " starting" << std::endl; + + std::string command = "PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/" XRT_IPC_MSG_SOCK_FILENAME " %command%"; + if (auto p = active_runtime::manifest_path().string(); p.starts_with("/usr")) + command = "XR_RUNTIME_JSON=/run/host" + p + " " + command; + + std::cerr << "For Steam games, set command to " << command << std::endl; + #ifdef WIVRN_USE_SYSTEMD create_listen_socket(); #else