From 4a5c3c4861fb503c7ecb6dcfc86aeb547aa3fb7f Mon Sep 17 00:00:00 2001 From: Saltaformajo Date: Mon, 6 Feb 2023 00:53:13 +0200 Subject: [PATCH] explicit config path for autoreload config #1423 (#1494) * respect explicit config path for autoreload config --- src/config/ConfigManager.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 8bc12fda..614670e1 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -1333,10 +1333,14 @@ void CConfigManager::loadConfigLoadVars() { } void CConfigManager::tick() { - static const char* const ENVHOME = getenv("HOME"); - - const std::string CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); - + std::string CONFIGPATH; + if (g_pCompositor->explicitConfigPath.empty()) { + static const char* const ENVHOME = getenv("HOME"); + CONFIGPATH = ENVHOME + (ISDEBUG ? (std::string) "/.config/hypr/hyprlandd.conf" : (std::string) "/.config/hypr/hyprland.conf"); + } else { + CONFIGPATH = g_pCompositor->explicitConfigPath; + } + if (!std::filesystem::exists(CONFIGPATH)) { Debug::log(ERR, "Config doesn't exist??"); return;