From 477cf6ad04b73e4d448abc6925cdb328d63521c3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 11:18:05 -0500 Subject: Adding an upstart job configuration --- .bzrignore | 1 + data/Makefile.am | 10 +++++++++- data/indicator-application.conf.in | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 data/indicator-application.conf.in diff --git a/.bzrignore b/.bzrignore index f73cbd7..618ca76 100644 --- a/.bzrignore +++ b/.bzrignore @@ -110,3 +110,4 @@ bindings/mono/policy.0.0.appindicator-sharp.config bindings/mono/policy.0.0.appindicator-sharp.dll src/libapplication_la-generate-id.lo src/libappindicator_la-generate-id.lo +indicator-application.conf diff --git a/data/Makefile.am b/data/Makefile.am index c142c4e..12ee39c 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,13 +5,21 @@ dbus_services_DATA = indicator-application.service %.service: %.service.in sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ +upstart_jobsdir = $(datadir)/upstart/sessions/ +upstart_jobs_DATA = indicator-application.conf + +%.conf: %.conf.in + sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + overridedir = $(pkgdatadir) override_DATA = ordering-override.keyfile EXTRA_DIST = \ indicator-application.service.in \ + indicator-application.conf.in \ ordering-override.keyfile CLEANFILES = \ - indicator-application.service + indicator-application.service \ + indicator-application.conf diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in new file mode 100644 index 0000000..2e452a3 --- /dev/null +++ b/data/indicator-application.conf.in @@ -0,0 +1,16 @@ +description "Indicator Application Service" +author "Ted Gould " + +start on indicators-loaded +stop on desktop-end + +emits appindicators-start appindicators-end + +env G_MESSAGES_DEBUG=all +export G_MESSAGES_DEBUG + +respawn + +exec @libexecdir@/indicator-application-service + +pre-stop initctl emit appindicators-end -- cgit v1.2.3 From a6999f41b1da373b48e897d8fbd218617a5fefa2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 11:43:45 -0500 Subject: Dropping the dbus service file --- configure.ac | 11 ----------- data/Makefile.am | 6 ------ data/indicator-application.service.in | 3 --- 3 files changed, 20 deletions(-) delete mode 100644 data/indicator-application.service.in diff --git a/configure.ac b/configure.ac index 1cc1811..2d1ccc0 100644 --- a/configure.ac +++ b/configure.ac @@ -88,17 +88,6 @@ fi AC_SUBST(INDICATORDIR) AC_SUBST(INDICATORICONSDIR) -########################### -# DBus Service Info -########################### - -if test "x$with_localinstall" = "xyes"; then - DBUSSERVICEDIR="${datadir}/dbus-1/services/" -else - DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` -fi -AC_SUBST(DBUSSERVICEDIR) - ########################### # Files ########################### diff --git a/data/Makefile.am b/data/Makefile.am index 12ee39c..85cb9c0 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,10 +1,4 @@ -dbus_servicesdir = $(DBUSSERVICEDIR) -dbus_services_DATA = indicator-application.service - -%.service: %.service.in - sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - upstart_jobsdir = $(datadir)/upstart/sessions/ upstart_jobs_DATA = indicator-application.conf diff --git a/data/indicator-application.service.in b/data/indicator-application.service.in deleted file mode 100644 index f6ceee3..0000000 --- a/data/indicator-application.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.canonical.indicator.application -Exec=@libexecdir@/indicator-application-service -- cgit v1.2.3 From 3051b7a294a8b0c468d69f1c578f9eb41313c2e9 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 13:25:47 -0500 Subject: When we get our name, then start app indicators --- src/application-service-watcher.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index edbf05b..c4fa9b4 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -286,5 +286,32 @@ get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data) return; } + GError * spawn_error = NULL; + gchar * argv[] = { + "initctl", + "--session", + "--user", + "emit", + "--no-wait", + "appindicators-start", + NULL, + }; + + g_spawn_async(NULL, /* Working Directory */ + argv, + NULL, /* environment */ + G_SPAWN_SEARCH_PATH, + NULL, NULL, /* child setup function */ + NULL, /* Pid */ + &spawn_error); + + if (spawn_error != NULL) { + /* NOTE: When we get to the point where we can start + assuming upstart user sessions this can be escillated + to a warning or higher */ + g_debug("Unable to signal appindicators-start to upstart: %s", spawn_error->message); + g_error_free(spawn_error); + } + return; } -- cgit v1.2.3 From fe92d7d922e827c654ba0db27b52b2f35ad5e162 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 13:27:51 -0500 Subject: A comment, because comments rock. --- src/application-service-watcher.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/application-service-watcher.c b/src/application-service-watcher.c index c4fa9b4..8c2f539 100644 --- a/src/application-service-watcher.c +++ b/src/application-service-watcher.c @@ -286,6 +286,10 @@ get_name_cb (DBusGProxy * proxy, guint status, GError * error, gpointer data) return; } + /* After we've got the name we can request upstart to trigger + the jobs of any application indicators that need to start + at desktop init time. */ + GError * spawn_error = NULL; gchar * argv[] = { "initctl", -- cgit v1.2.3 From 7b8ff473585d69595766d728493a15e398045848 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 13:32:07 -0500 Subject: Limiting to only the ubuntu session --- data/indicator-application.conf.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in index 2e452a3..351ac74 100644 --- a/data/indicator-application.conf.in +++ b/data/indicator-application.conf.in @@ -1,7 +1,10 @@ description "Indicator Application Service" author "Ted Gould " -start on indicators-loaded +# NOTE: Limiting only to Unity 7 right now as it's still using +# dbusmenu. That can be lifted after it is ported to GMenu + +start on indicators-loaded and xsession SESSION=ubuntu stop on desktop-end emits appindicators-start appindicators-end -- cgit v1.2.3 From 634e24e0a367100f76bd4701f27d54aaf53d7732 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 29 May 2013 14:23:35 -0500 Subject: Dropping service from extra dist and clean --- data/Makefile.am | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/Makefile.am b/data/Makefile.am index 85cb9c0..c6e82b2 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -9,11 +9,9 @@ overridedir = $(pkgdatadir) override_DATA = ordering-override.keyfile EXTRA_DIST = \ - indicator-application.service.in \ indicator-application.conf.in \ ordering-override.keyfile CLEANFILES = \ - indicator-application.service \ indicator-application.conf -- cgit v1.2.3 From e5d5f1ab26a6a18ce9011f24bc954bc39e62f461 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Jul 2013 16:03:55 -0500 Subject: Make sure to have proper syntax --- data/indicator-application.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in index 351ac74..289d7fc 100644 --- a/data/indicator-application.conf.in +++ b/data/indicator-application.conf.in @@ -16,4 +16,4 @@ respawn exec @libexecdir@/indicator-application-service -pre-stop initctl emit appindicators-end +pre-stop exec initctl emit appindicators-end -- cgit v1.2.3 From 77943e2d82cd637cf761936494d745355ad38dd2 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Jul 2013 16:04:11 -0500 Subject: Add the indicator-services-start condition --- data/indicator-application.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in index 289d7fc..459878d 100644 --- a/data/indicator-application.conf.in +++ b/data/indicator-application.conf.in @@ -4,7 +4,7 @@ author "Ted Gould " # NOTE: Limiting only to Unity 7 right now as it's still using # dbusmenu. That can be lifted after it is ported to GMenu -start on indicators-loaded and xsession SESSION=ubuntu +start on (indicators-loaded or indicator-services-start) and xsession SESSION=ubuntu stop on desktop-end emits appindicators-start appindicators-end -- cgit v1.2.3 From f3246fc5ba078608699ded2dd0fbecc571302cdb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 12 Jul 2013 16:04:36 -0500 Subject: Add the indicator-services-end condition --- data/indicator-application.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in index 459878d..8aec4eb 100644 --- a/data/indicator-application.conf.in +++ b/data/indicator-application.conf.in @@ -5,7 +5,7 @@ author "Ted Gould " # dbusmenu. That can be lifted after it is ported to GMenu start on (indicators-loaded or indicator-services-start) and xsession SESSION=ubuntu -stop on desktop-end +stop on desktop-end or indicator-services-end emits appindicators-start appindicators-end -- cgit v1.2.3 From bcd73f4d74fe781526cf224cee2ed7d87eeb16ee Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 27 Aug 2013 15:15:52 -0500 Subject: Dropping debugging for system-wide support --- data/indicator-application.conf.in | 4 ---- 1 file changed, 4 deletions(-) diff --git a/data/indicator-application.conf.in b/data/indicator-application.conf.in index 8aec4eb..ddc803c 100644 --- a/data/indicator-application.conf.in +++ b/data/indicator-application.conf.in @@ -1,5 +1,4 @@ description "Indicator Application Service" -author "Ted Gould " # NOTE: Limiting only to Unity 7 right now as it's still using # dbusmenu. That can be lifted after it is ported to GMenu @@ -9,9 +8,6 @@ stop on desktop-end or indicator-services-end emits appindicators-start appindicators-end -env G_MESSAGES_DEBUG=all -export G_MESSAGES_DEBUG - respawn exec @libexecdir@/indicator-application-service -- cgit v1.2.3 From 96efd3b86974e72d1c23a328e6892cacefc79e8c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 28 Oct 2013 17:01:19 -0700 Subject: Adding an XDG Autostart file --- .bzrignore | 1 + data/Makefile.am | 7 +++++++ data/indicator-application.desktop.in | 9 +++++++++ 3 files changed, 17 insertions(+) create mode 100644 data/indicator-application.desktop.in diff --git a/.bzrignore b/.bzrignore index 618ca76..317a187 100644 --- a/.bzrignore +++ b/.bzrignore @@ -111,3 +111,4 @@ bindings/mono/policy.0.0.appindicator-sharp.dll src/libapplication_la-generate-id.lo src/libappindicator_la-generate-id.lo indicator-application.conf +indicator-application.desktop diff --git a/data/Makefile.am b/data/Makefile.am index c6e82b2..77ec71d 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -5,10 +5,17 @@ upstart_jobs_DATA = indicator-application.conf %.conf: %.conf.in sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ +xdg_autostartdir = /etc/xdg/autostart +xdg_autostart_DATA = indicator-application.desktop + +%.desktop: %.desktop.in + sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ + overridedir = $(pkgdatadir) override_DATA = ordering-override.keyfile EXTRA_DIST = \ + indicator-application.desktop.in \ indicator-application.conf.in \ ordering-override.keyfile diff --git a/data/indicator-application.desktop.in b/data/indicator-application.desktop.in new file mode 100644 index 0000000..61d3c4d --- /dev/null +++ b/data/indicator-application.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Indicator Application +Exec=@libexecdir@/indicator-application-service +NotShowIn=Unity; +NoDisplay=true +StartupNotify=false +Terminal=false + -- cgit v1.2.3