[gnome-session/wip/benzea/systemd-user-switch: 5/21] Add GNOME_SESSION_AUTOSTART_DIR variable to set the autostart dirs



commit 8926f72a6674093b279a069a0f25924a3fbf169f
Author: Iain Lane <iainl gnome org>
Date:   Wed Jun 20 09:44:50 2018 +0100

    Add GNOME_SESSION_AUTOSTART_DIR variable to set the autostart dirs
    
    This is so that we can be started by systemd, yet still autostart things
    from the right place if necessary - e.g. for the gdm session.

 gnome-session/main.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 9a7f5540..da1ae7d9 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -270,6 +270,8 @@ main (int argc, char **argv)
         static char     **override_autostart_dirs = NULL;
         static char      *opt_session_name = NULL;
         const char       *debug_string = NULL;
+        const char       *env_override_autostart_dirs = NULL;
+        g_auto(GStrv)     env_override_autostart_dirs_v = NULL;
         gboolean          gl_failed = FALSE;
         guint             name_owner_id;
         GOptionContext   *options;
@@ -412,7 +414,15 @@ main (int argc, char **argv)
          */
         gsm_util_setenv ("XDG_MENU_PREFIX", "gnome-");
 
-        gsm_util_set_autostart_dirs (override_autostart_dirs);
+        env_override_autostart_dirs = g_getenv ("GNOME_SESSION_AUTOSTART_DIR");
+
+        if (env_override_autostart_dirs != NULL && env_override_autostart_dirs[0] != '\0') {
+                env_override_autostart_dirs_v = g_strsplit (env_override_autostart_dirs, ":", 0);
+                gsm_util_set_autostart_dirs (env_override_autostart_dirs_v);
+        } else {
+                gsm_util_set_autostart_dirs (override_autostart_dirs);
+        }
+
         session_name = opt_session_name;
 
         /* Talk to logind before acquiring a name, since it does synchronous


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]