diff --git a/sway/main.c b/sway/main.c index 85bc2f1c9..546e3f186 100644 --- a/sway/main.c +++ b/sway/main.c @@ -26,6 +26,12 @@ #include "stringop.h" #include "util.h" +#ifdef HAVE_LIBSYSTEMD +#include +#elif HAVE_LIBELOGIND +#include +#endif + static bool terminate_request = false; static int exit_value = 0; static struct rlimit original_nofile_rlimit = {0}; @@ -412,6 +418,11 @@ int main(int argc, char **argv) { swaynag_show(&config->swaynag_config_errors); } +#if defined(HAVE_LIBSYSTEMD) || defined(HAVE_LIBELOGIND) + /* Signal systemd that we are ready to accept connections */ + sd_notify(0, "READY=1"); +#endif + server_run(&server); shutdown: diff --git a/sway/meson.build b/sway/meson.build index 3abd778db..d5bb10467 100644 --- a/sway/meson.build +++ b/sway/meson.build @@ -236,6 +236,10 @@ if have_xwayland sway_sources += 'desktop/xwayland.c' endif +if sdbus.found() + sway_deps += sdbus +endif + if wlroots_features['libinput_backend'] sway_sources += 'input/libinput.c' endif