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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 60 additions and 33 deletions

View file

@ -1746,7 +1746,7 @@ void CHyprCtl::startHyprCtlSocket() {
sockaddr_un SERVERADDRESS = {.sun_family = AF_UNIX};
std::string socketPath = "/tmp/hypr/" + g_pCompositor->m_szInstanceSignature + "/.socket.sock";
std::string socketPath = g_pCompositor->m_szInstancePath + "/.socket.sock";
strcpy(SERVERADDRESS.sun_path, socketPath.c_str());

View file

@ -6,7 +6,7 @@
#include <iostream>
void Debug::init(const std::string& IS) {
logFile = "/tmp/hypr/" + IS + (ISDEBUG ? "/hyprlandd.log" : "/hyprland.log");
logFile = IS + (ISDEBUG ? "/hyprlandd.log" : "/hyprland.log");
}
void Debug::wlrLog(wlr_log_importance level, const char* fmt, va_list args) {