mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-08 02:25:59 +01:00
prefer xdg env
This commit is contained in:
parent
80cff19117
commit
48c84099ba
1 changed files with 6 additions and 5 deletions
|
@ -63,14 +63,15 @@ void handleUserSignal(int sig) {
|
|||
CCompositor::CCompositor() {
|
||||
m_iHyprlandPID = getpid();
|
||||
|
||||
const auto PWUID = getpwuid(getuid());
|
||||
if (!PWUID) {
|
||||
std::cout << "Bailing out, getpwuid(getuid()) failed. Are you running as a proper user?\n";
|
||||
m_szHyprTempDataRoot = std::string{getenv("XDG_RUNTIME_DIR")} + "/hypr";
|
||||
|
||||
if (m_szHyprTempDataRoot.starts_with("/hypr")) {
|
||||
std::cout << "Bailing out, XDG_RUNTIME_DIR is invalid\n";
|
||||
throw std::runtime_error("CCompositor() failed");
|
||||
}
|
||||
|
||||
const std::string USERID = std::to_string(PWUID->pw_uid);
|
||||
m_szHyprTempDataRoot = "/run/user/" + USERID + "/hypr";
|
||||
if (!m_szHyprTempDataRoot.starts_with("/run/user"))
|
||||
std::cout << "[!!WARNING!!] XDG_RUNTIME_DIR looks non-standard. Proceeding anyways...\n";
|
||||
|
||||
std::random_device dev;
|
||||
std::mt19937 engine(dev());
|
||||
|
|
Loading…
Reference in a new issue