core: Move /tmp/hypr to $XDG_RUNTIME_DIR/hypr (#5788)

Moves the directory containing sockets and logs.
Also restructures lockfiles a bit.

For consumers, check if `$XDG_RUNTIME_DIR/hypr` exists. If so, use it. If not, use the old `/tmp/hypr`.
This commit is contained in:
Vaxry
2024-04-28 22:25:24 +01:00
committed by GitHub
parent d20ee31210
commit a5a6480917
9 changed files with 60 additions and 33 deletions

View File

@@ -2,6 +2,7 @@
#include "../debug/Log.hpp"
#include "../helpers/VarList.hpp"
#include "../managers/TokenManager.hpp"
#include "../Compositor.hpp"
#define register
#include <udis86.h>
@@ -138,7 +139,7 @@ CFunctionHook::SAssembly CFunctionHook::fixInstructionProbeRIPCalls(const SInstr
currentAddress += len;
}
const auto RANDOMDIR = "/tmp/hypr/" + g_pTokenManager->getRandomUUID();
const auto RANDOMDIR = g_pCompositor->m_szInstancePath + "/" + g_pTokenManager->getRandomUUID();
if (std::filesystem::exists(RANDOMDIR)) {
Debug::log(ERR, "[hooksystem] random out dir exists??");