core: check if on_(un)lock_cmd is empty

This commit is contained in:
Maximilian Seidler 2025-02-05 18:16:01 +01:00 committed by Maximilian Seidler
parent be173c50be
commit fd785ec299

View file

@ -313,7 +313,7 @@ void CHypridle::onLocked() {
m_isLocked = true;
static const auto LOCKCMD = g_pConfigManager->getValue<Hyprlang::STRING>("general:on_lock_cmd");
if (*LOCKCMD)
if (!std::string{*LOCKCMD}.empty())
spawn(*LOCKCMD);
if (m_inhibitSleepBehavior == SLEEP_INHIBIT_LOCK_NOTIFY)
@ -328,7 +328,7 @@ void CHypridle::onUnlocked() {
inhibitSleep();
static const auto UNLOCKCMD = g_pConfigManager->getValue<Hyprlang::STRING>("general:on_unlock_cmd");
if (*UNLOCKCMD)
if (!std::string{*UNLOCKCMD}.empty())
spawn(*UNLOCKCMD);
}