mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 06:18:05 +02:00
config: fix safe mode config generation (#14024)
This commit is contained in:
parent
933a24caa6
commit
e539d21174
2 changed files with 13 additions and 8 deletions
|
|
@ -36,12 +36,6 @@ bool Config::initConfigManager() {
|
|||
Log::logger->log(Log::CRIT, "Couldn't load config: {}", ec.message());
|
||||
return false;
|
||||
}
|
||||
|
||||
// generate default
|
||||
if (const auto v = g_mgr->generateDefaultConfig(filePath); !v) {
|
||||
Log::logger->log(Log::CRIT, "Couldn't generate default config: {}", v.error());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -987,8 +987,19 @@ void CConfigManager::reloadRuleConfigs() {
|
|||
std::optional<std::string> CConfigManager::verifyConfigExists() {
|
||||
auto mainConfigPath = Supplementary::Jeremy::getMainConfigPath();
|
||||
|
||||
if (!mainConfigPath || !std::filesystem::exists(*mainConfigPath))
|
||||
return "broken config dir?";
|
||||
if (!mainConfigPath)
|
||||
return "Broken config directory";
|
||||
|
||||
std::error_code ec;
|
||||
const bool VALID_CFG = std::filesystem::exists(*mainConfigPath, ec) && !ec;
|
||||
|
||||
if (!VALID_CFG && !g_pCompositor->m_explicitConfigPath.empty())
|
||||
return "Invalid config file provided as explicit";
|
||||
|
||||
if (!VALID_CFG) {
|
||||
if (const auto res = generateDefaultConfig(*mainConfigPath, g_pCompositor->m_safeMode); !res)
|
||||
return res.error();
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue