mirror of
https://github.com/hyprwm/hyprlock.git
synced 2026-05-02 19:07:59 +02:00
add capability to use command line or config to set value of grace giving command line precedence
This commit is contained in:
parent
36ec73f166
commit
487ac989a0
2 changed files with 5 additions and 2 deletions
|
|
@ -214,6 +214,7 @@ void CConfigManager::init() {
|
|||
|
||||
m_config.addConfigValue("general:text_trim", Hyprlang::INT{1});
|
||||
m_config.addConfigValue("general:hide_cursor", Hyprlang::INT{0});
|
||||
m_config.addConfigValue("general:grace", Hyprlang::INT{0});
|
||||
m_config.addConfigValue("general:ignore_empty_input", Hyprlang::INT{0});
|
||||
m_config.addConfigValue("general:immediate_render", Hyprlang::INT{0});
|
||||
m_config.addConfigValue("general:fractional_scaling", Hyprlang::INT{2});
|
||||
|
|
|
|||
|
|
@ -45,8 +45,10 @@ CHyprlock::CHyprlock(const std::string& wlDisplay, const bool immediateRender, c
|
|||
|
||||
if (graceSeconds > 0)
|
||||
m_tGraceEnds = std::chrono::system_clock::now() + std::chrono::seconds(graceSeconds);
|
||||
else
|
||||
m_tGraceEnds = std::chrono::system_clock::from_time_t(0);
|
||||
else {
|
||||
static const auto GRACE = g_pConfigManager->getValue<Hyprlang::INT>("general:grace");
|
||||
m_tGraceEnds = *GRACE ? std::chrono::system_clock::now() + std::chrono::seconds(*GRACE) : std::chrono::system_clock::from_time_t(0);
|
||||
}
|
||||
|
||||
static const auto IMMEDIATERENDER = g_pConfigManager->getValue<Hyprlang::INT>("general:immediate_render");
|
||||
m_bImmediateRender = immediateRender || *IMMEDIATERENDER;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue