summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5b56944e..7d1353ba 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4,6 +4,9 @@
#include "config/ConfigManager.hpp"
#include "init/initHelpers.hpp"
#include <iostream>
+#ifdef USES_SYSTEMD
+#include <systemd/sd-daemon.h> // for sd_notify
+#endif
int main(int argc, char** argv) {
@@ -66,6 +69,12 @@ int main(int argc, char** argv) {
// If we are here it means we got yote.
Debug::log(LOG, "Hyprland reached the end.");
+#ifdef USES_SYSTEMD
+ // tell systemd it destroy bound/related units
+ if (sd_booted() > 0)
+ sd_notify(0, "STOPPING=1");
+#endif
+
wl_display_destroy_clients(g_pCompositor->m_sWLDisplay);
// kill all clients