- context = sn_launcher_context_new(sndisplay, conn_screen);
- sn_launcher_context_set_name(context, "i3");
- sn_launcher_context_set_description(context, "exec command in i3");
- /* Chop off everything starting from the first space (if there are any
- * spaces in the command), since we don’t want the parameters. */
- char *first_word = sstrdup(command);
- char *space = strchr(first_word, ' ');
- if (space)
- *space = '\0';
- sn_launcher_context_initiate(context, "i3", first_word, last_timestamp);
- free(first_word);
-
- /* Trigger a timeout after 60 seconds */
- struct ev_timer *timeout = scalloc(sizeof(struct ev_timer));
- ev_timer_init(timeout, startup_timeout, 60.0, 0.);
- timeout->data = context;
- ev_timer_start(main_loop, timeout);
-
- LOG("startup id = %s\n", sn_launcher_context_get_startup_id(context));
-
- /* Save the ID and current workspace in our internal list of startup
- * sequences */
- Con *ws = con_get_workspace(focused);
- struct Startup_Sequence *sequence = scalloc(sizeof(struct Startup_Sequence));
- sequence->id = sstrdup(sn_launcher_context_get_startup_id(context));
- sequence->workspace = sstrdup(ws->name);
- sequence->context = context;
- TAILQ_INSERT_TAIL(&startup_sequences, sequence, sequences);
-
- /* Increase the refcount once (it starts with 1, so it will be 2 now) for
- * the timeout. Even if the sequence gets completed, the timeout still
- * needs the context (but will unref it then) */
- sn_launcher_context_ref(context);
+
+ if (!no_startup_id) {
+ /* Create a startup notification context to monitor the progress of this
+ * startup. */
+ context = sn_launcher_context_new(sndisplay, conn_screen);
+ sn_launcher_context_set_name(context, "i3");
+ sn_launcher_context_set_description(context, "exec command in i3");
+ /* Chop off everything starting from the first space (if there are any
+ * spaces in the command), since we don’t want the parameters. */
+ char *first_word = sstrdup(command);
+ char *space = strchr(first_word, ' ');
+ if (space)
+ *space = '\0';
+ sn_launcher_context_initiate(context, "i3", first_word, last_timestamp);
+ free(first_word);
+
+ /* Trigger a timeout after 60 seconds */
+ struct ev_timer *timeout = scalloc(sizeof(struct ev_timer));
+ ev_timer_init(timeout, startup_timeout, 60.0, 0.);
+ timeout->data = context;
+ ev_timer_start(main_loop, timeout);
+
+ LOG("startup id = %s\n", sn_launcher_context_get_startup_id(context));
+
+ /* Save the ID and current workspace in our internal list of startup
+ * sequences */
+ Con *ws = con_get_workspace(focused);
+ struct Startup_Sequence *sequence = scalloc(sizeof(struct Startup_Sequence));
+ sequence->id = sstrdup(sn_launcher_context_get_startup_id(context));
+ sequence->workspace = sstrdup(ws->name);
+ sequence->context = context;
+ TAILQ_INSERT_TAIL(&startup_sequences, sequence, sequences);
+
+ /* Increase the refcount once (it starts with 1, so it will be 2 now) for
+ * the timeout. Even if the sequence gets completed, the timeout still
+ * needs the context (but will unref it then) */
+ sn_launcher_context_ref(context);
+ }