diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-08-10 10:07:58 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-08-10 10:07:58 +0200 |
commit | 8189b651e2ab4b22fb2c471e8436e93cb914a49b (patch) | |
tree | f6c3c0e7d555b6e6838489e5a6c5f2de41579a24 | |
parent | ac5d6867a8ce34b8a77bf5545bbb4b36f8bafb15 (diff) | |
download | ayatana-indicator-notifications-8189b651e2ab4b22fb2c471e8436e93cb914a49b.tar.gz ayatana-indicator-notifications-8189b651e2ab4b22fb2c471e8436e93cb914a49b.tar.bz2 ayatana-indicator-notifications-8189b651e2ab4b22fb2c471e8436e93cb914a49b.zip |
Start indicator in systemd when ayatana-indicators.target is started.
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | data/Makefile.am | 19 | ||||
-rw-r--r-- | data/ayatana-indicator-notifications.service.in | 11 |
3 files changed, 41 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index e9bc3bd..8b3b48b 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,19 @@ PKG_CHECK_MODULES(SETTINGS, gtk+-3.0 >= GTK3_REQUIRED_VERSION) AC_SUBST(SETTINGS_CFLAGS) AC_SUBST(SETTINGS_LIBS) +######################### +# Check for systemd +######################### +PKG_CHECK_MODULES(SYSTEMD, systemd, + [has_systemd=yes], + [] +) +if test "x$has_systemd" = "xyes"; then + SYSTEMD_USERDIR=`$PKG_CONFIG --variable=systemduserunitdir systemd` + AC_SUBST(SYSTEMD_USERDIR) + AC_DEFINE(HAVE_SYSTEMD, 1, [create ayatana-indicator-application.service for systemd]) +fi + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 1960ad7..52f61a7 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,3 +1,5 @@ +NULL = + SUBDIRS = icons gsettings_file = org.ayatana.indicator.notifications.gschema.xml @@ -12,10 +14,23 @@ $(gsettings_file).in: $(gsettings_file).in.in @GSETTINGS_RULES@ +#if defined(HAVE_SYSTEMD) +systemdservice_file = ayatana-indicator-notifications.service +$(systemdservice_file): $(systemdservice_file).in + $(AM_V_GEN) sed -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ + +systemddir = $(SYSTEMD_USERDIR) +systemd_DATA = $(systemdservice_file) +#endif + EXTRA_DIST = \ - $(gsettings_file).in.in + $(gsettings_file).in.in \ + $(systemdservice_file).in \ + $(NULL) CLEANFILES = \ $(gsettings_file) \ $(gsettings_file).in \ - *.gschema.valid + *.gschema.valid \ + $(systemdservice_file) \ + $(NULL) diff --git a/data/ayatana-indicator-notifications.service.in b/data/ayatana-indicator-notifications.service.in new file mode 100644 index 0000000..d356f01 --- /dev/null +++ b/data/ayatana-indicator-notifications.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Ayatana Indicator Notifications Service +PartOf=graphical-session.target +After=ayatana-indicators.target + +[Service] +ExecStart=@pkglibexecdir@/ayatana-indicator-notifications-service +Restart=on-failure + +[Install] +WantedBy=ayatana-indicators.target |