Skip to content

Commit 37fe7b2

Browse files
committed
config: export version variable for versioned configs
fixes #12274
1 parent c2670e9 commit 37fe7b2

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

src/config/ConfigManager.cpp

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,12 +990,34 @@ std::string CConfigManager::getErrors() {
990990
return m_configErrors;
991991
}
992992

993+
static std::vector<const char*> HL_VERSION_VARS = {
994+
"HYPRLAND_V_0_53",
995+
};
996+
997+
static void exportHlVersionVars() {
998+
for (const auto& v : HL_VERSION_VARS) {
999+
setenv(v, "1", 1);
1000+
}
1001+
}
1002+
1003+
static void clearHlVersionVars() {
1004+
for (const auto& v : HL_VERSION_VARS) {
1005+
unsetenv(v);
1006+
}
1007+
}
1008+
9931009
void CConfigManager::reload() {
9941010
EMIT_HOOK_EVENT("preConfigReload", nullptr);
9951011
setDefaultAnimationVars();
9961012
resetHLConfig();
997-
m_configCurrentPath = getMainConfigPath();
998-
const auto ERR = m_config->parse();
1013+
m_configCurrentPath = getMainConfigPath();
1014+
1015+
exportHlVersionVars();
1016+
1017+
const auto ERR = m_config->parse();
1018+
1019+
clearHlVersionVars();
1020+
9991021
const auto monitorError = handleMonitorv2();
10001022
const auto ruleError = reloadRules();
10011023
m_lastConfigVerificationWasSuccessful = !ERR.error && !monitorError.error;

0 commit comments

Comments
 (0)