explicit config path for autoreload config #1423 (#1494)

* respect explicit config path for autoreload config
This commit is contained in:
Saltaformajo 2023-02-06 00:53:13 +02:00 committed by GitHub
parent 15544c7544
commit 4a5c3c4861
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1333,9 +1333,13 @@ void CConfigManager::loadConfigLoadVars() {
}
void CConfigManager::tick() {
std::string CONFIGPATH;
if (g_pCompositor->explicitConfigPath.empty()) {
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");
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??");