* seconds ago or earlier. */
struct Startup_Sequence *current, *next;
for (next = TAILQ_FIRST(&startup_sequences);
- next != TAILQ_END(&startup_sequences);
- ) {
+ next != TAILQ_END(&startup_sequences);) {
current = next;
next = TAILQ_NEXT(next, sequences);
}
return active_sequences;
-
}
/**
* the application is reparented to init (process-id 1), which correctly handles
* childs, so we don’t have to do it :-).
*
- * The shell is determined by looking for the SHELL environment variable. If it
- * does not exist, /bin/sh is used.
+ * The shell used to start applications is the system's bourne shell (i.e.,
+ * /bin/sh).
*
* The no_startup_id flag determines whether a startup notification context
* (and ID) should be created, which is the default and encouraged behavior.
if (!no_startup_id)
sn_launcher_context_setup_child_process(context);
- execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (void*)NULL);
+ execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, (void *)NULL);
/* not reached */
}
_exit(0);
/* Change the pointer of the root window to indicate progress */
if (xcursor_supported)
xcursor_set_root_cursor(XCURSOR_CURSOR_WATCH);
- else xcb_set_root_cursor(XCURSOR_CURSOR_WATCH);
+ else
+ xcb_set_root_cursor(XCURSOR_CURSOR_WATCH);
}
}
/* Change the pointer of the root window to indicate progress */
if (xcursor_supported)
xcursor_set_root_cursor(XCURSOR_CURSOR_POINTER);
- else xcb_set_root_cursor(XCURSOR_CURSOR_POINTER);
+ else
+ xcb_set_root_cursor(XCURSOR_CURSOR_POINTER);
}
break;
default:
}
}
+/**
+ * Renames workspaces that are mentioned in the startup sequences.
+ *
+ */
+void startup_sequence_rename_workspace(char *old_name, char *new_name) {
+ struct Startup_Sequence *current;
+ TAILQ_FOREACH(current, &startup_sequences, sequences) {
+ if (strcmp(current->workspace, old_name) != 0)
+ continue;
+ DLOG("Renaming workspace \"%s\" to \"%s\" in startup sequence %s.\n",
+ old_name, new_name, current->id);
+ free(current->workspace);
+ current->workspace = sstrdup(new_name);
+ }
+}
+
/**
* Gets the stored startup sequence for the _NET_STARTUP_ID of a given window.
*
*/
struct Startup_Sequence *startup_sequence_get(i3Window *cwindow,
- xcb_get_property_reply_t *startup_id_reply, bool ignore_mapped_leader) {
+ xcb_get_property_reply_t *startup_id_reply, bool ignore_mapped_leader) {
/* The _NET_STARTUP_ID is only needed during this function, so we get it
* here and don’t save it in the 'cwindow'. */
if (startup_id_reply == NULL || xcb_get_property_value_length(startup_id_reply) == 0) {
xcb_get_property_cookie_t cookie;
cookie = xcb_get_property(conn, false, cwindow->leader,
- A__NET_STARTUP_ID, XCB_GET_PROPERTY_TYPE_ANY, 0, 512);
+ A__NET_STARTUP_ID, XCB_GET_PROPERTY_TYPE_ANY, 0, 512);
startup_id_reply = xcb_get_property_reply(conn, cookie, NULL);
if (startup_id_reply == NULL ||
char *startup_id;
if (asprintf(&startup_id, "%.*s", xcb_get_property_value_length(startup_id_reply),
- (char*)xcb_get_property_value(startup_id_reply)) == -1) {
+ (char *)xcb_get_property_value(startup_id_reply)) == -1) {
perror("asprintf()");
DLOG("Could not get _NET_STARTUP_ID\n");
free(startup_id_reply);