mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-08 16:11:57 -07:00
add systemd support (#1253)
* add systemd support motivation for this is is proper ordering of related/bound/required services to Hyprland (e.g. swaybg) that would need to have a compositor ready. this could possibly be a build-time option of course. see also: example/ files for example of services Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com> * nix: add withSystemd flag Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com> Co-authored-by: Mihai Fufezan <fufexan@protonmail.com> Co-authored-by: Vaxerski <vaxry@vaxry.net>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user