diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 8740f09..564783e 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -286,6 +286,13 @@ void CHyprlock::onGlobalRemoved(void* data, struct wl_registry* registry, uint32 // end wl_registry +static void handleUnlockSignal(int sig) { + if (sig == SIGUSR1) { + Debug::log(LOG, "Unlocking with a SIGUSR1"); + g_pHyprlock->unlockSession(); + } +} + void CHyprlock::run() { m_sWaylandState.registry = wl_display_get_registry(m_sWaylandState.display); @@ -305,6 +312,8 @@ void CHyprlock::run() { lockSession(); + signal(SIGUSR1, handleUnlockSignal); + pollfd pollfds[] = { { .fd = wl_display_get_fd(m_sWaylandState.display),