From 8b9f887844a2226e2d095e10e089e1dd32f4b733 Mon Sep 17 00:00:00 2001 From: Robyn Dressler Date: Thu, 3 Oct 2024 18:31:02 -0500 Subject: [PATCH] Using a more standard data directory for linux --- src/common/path_util.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index 27098e2d1..a8422e90a 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -95,6 +95,14 @@ static auto UserPaths = [] { user_dir = std::filesystem::path(getenv("HOME")) / "Library" / "Application Support" / "shadPS4"; } +#elif defined(__linux__) + auto user_dir = std::filesystem::current_path() / PORTABLE_DIR; + // Check if the "user" directory exists in the current path: + if (!std::filesystem::exists(user_dir)) { + // If it doesn't exist, use the new hardcoded path: + user_dir = + std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4"; + } #else const auto user_dir = std::filesystem::current_path() / PORTABLE_DIR; #endif