mirror of
https://github.com/hyprwm/hypridle.git
synced 2025-12-20 01:00:01 +01:00
parent
5430b73ddf
commit
f158b2fe92
3 changed files with 10 additions and 11 deletions
|
|
@ -18,6 +18,7 @@ CConfigManager::CConfigManager(std::string configPath) :
|
|||
m_config(configPath.empty() ? getMainConfigPath().c_str() : configPath.c_str(), Hyprlang::SConfigOptions{.throwAllErrors = true, .allowMissingConfig = false}) {
|
||||
;
|
||||
configCurrentPath = configPath.empty() ? getMainConfigPath() : configPath;
|
||||
configHeadPath = configCurrentPath;
|
||||
}
|
||||
|
||||
static Hyprlang::CParseResult handleSource(const char* c, const char* v) {
|
||||
|
|
@ -51,8 +52,7 @@ void CConfigManager::init() {
|
|||
m_config.addConfigValue("general:inhibit_sleep", Hyprlang::INT{2});
|
||||
|
||||
// track the file in the circular dependency chain
|
||||
const auto mainConfigPath = getMainConfigPath();
|
||||
alreadyIncludedSourceFiles.insert(std::filesystem::canonical(mainConfigPath));
|
||||
alreadyIncludedSourceFiles.insert(std::filesystem::canonical(configHeadPath));
|
||||
|
||||
m_config.registerHandler(&::handleSource, "source", {.allowFlags = false});
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class CConfigManager {
|
|||
|
||||
std::vector<STimeoutRule> getRules();
|
||||
std::optional<std::string> handleSource(const std::string&, const std::string&);
|
||||
std::string configCurrentPath;
|
||||
std::string configCurrentPath, configHeadPath;
|
||||
std::set<std::string> alreadyIncludedSourceFiles;
|
||||
|
||||
template <typename T>
|
||||
|
|
|
|||
15
src/main.cpp
15
src/main.cpp
|
|
@ -40,14 +40,13 @@ int main(int argc, char** argv, char** envp) {
|
|||
|
||||
else if (arg == "--help" || arg == "-h") {
|
||||
Debug::log(NONE,
|
||||
"Usage: hypridle [options]\n"
|
||||
"Options:\n"
|
||||
" -v, --verbose Enable verbose logging\n"
|
||||
" -q, --quiet Suppress all output except errors\n"
|
||||
" -V, --version Show version information\n"
|
||||
" -c, --config <path> Specify a custom config file path\n"
|
||||
" -h, --help Show this help message"
|
||||
);
|
||||
"Usage: hypridle [options]\n"
|
||||
"Options:\n"
|
||||
" -v, --verbose Enable verbose logging\n"
|
||||
" -q, --quiet Suppress all output except errors\n"
|
||||
" -V, --version Show version information\n"
|
||||
" -c, --config <path> Specify a custom config file path\n"
|
||||
" -h, --help Show this help message");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue