diff options
| author | Vaxry <vaxry@vaxry.net> | 2025-11-17 18:43:04 +0000 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2025-11-17 18:43:04 +0000 |
| commit | 37fe7b2efde3f572080de33a1fef1b8306ee8bda (patch) | |
| tree | 6d3973030639cdeff0eaf1e848f0b47737ffae86 /src/config/ConfigManager.cpp | |
| parent | c2670e9ab90bd657e87a1da2c5322e9007dce01f (diff) | |
config: export version variable for versioned configs
fixes #12274
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 8efbe945..775d3beb 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -990,12 +990,34 @@ std::string CConfigManager::getErrors() { return m_configErrors; } +static std::vector<const char*> HL_VERSION_VARS = { + "HYPRLAND_V_0_53", +}; + +static void exportHlVersionVars() { + for (const auto& v : HL_VERSION_VARS) { + setenv(v, "1", 1); + } +} + +static void clearHlVersionVars() { + for (const auto& v : HL_VERSION_VARS) { + unsetenv(v); + } +} + void CConfigManager::reload() { EMIT_HOOK_EVENT("preConfigReload", nullptr); setDefaultAnimationVars(); resetHLConfig(); - m_configCurrentPath = getMainConfigPath(); - const auto ERR = m_config->parse(); + m_configCurrentPath = getMainConfigPath(); + + exportHlVersionVars(); + + const auto ERR = m_config->parse(); + + clearHlVersionVars(); + const auto monitorError = handleMonitorv2(); const auto ruleError = reloadRules(); m_lastConfigVerificationWasSuccessful = !ERR.error && !monitorError.error; |
