mirror of
https://github.com/hyprwm/hypridle.git
synced 2026-01-02 23:40:07 +01:00
core: check if on_(un)lock_cmd is empty
This commit is contained in:
parent
15ca902b2c
commit
9207836556
1 changed files with 8 additions and 4 deletions
|
|
@ -351,8 +351,10 @@ void CHypridle::onLocked() {
|
|||
m_isLocked = true;
|
||||
|
||||
static const auto LOCKCMD = g_pConfigManager->getValue<Hyprlang::STRING>("general:on_lock_cmd");
|
||||
if (*LOCKCMD)
|
||||
spawn(*LOCKCMD);
|
||||
if (*LOCKCMD) {
|
||||
if (const std::string LOCKCMDSTR{*LOCKCMD}; !LOCKCMDSTR.empty())
|
||||
spawn(LOCKCMDSTR);
|
||||
}
|
||||
|
||||
if (m_inhibitSleepBehavior == SLEEP_INHIBIT_LOCK_NOTIFY)
|
||||
uninhibitSleep();
|
||||
|
|
@ -366,8 +368,10 @@ void CHypridle::onUnlocked() {
|
|||
inhibitSleep();
|
||||
|
||||
static const auto UNLOCKCMD = g_pConfigManager->getValue<Hyprlang::STRING>("general:on_unlock_cmd");
|
||||
if (*UNLOCKCMD)
|
||||
spawn(*UNLOCKCMD);
|
||||
if (*UNLOCKCMD) {
|
||||
if (const std::string UNLOCKCMDSTR{*UNLOCKCMD}; !UNLOCKCMDSTR.empty())
|
||||
spawn(UNLOCKCMDSTR);
|
||||
}
|
||||
}
|
||||
|
||||
CHypridle::SDbusInhibitCookie CHypridle::getDbusInhibitCookie(uint32_t cookie) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue