* Emulates mkdir -p (creates any missing folders)
*
*/
-static bool mkdirp(const char *path) {
+bool mkdirp(const char *path) {
if (mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) == 0)
return true;
if (errno != ENOENT) {
*/
void ipc_send_event(const char *event, uint32_t message_type, const char *payload) {
ipc_client *current;
- TAILQ_FOREACH (current, &all_clients, clients) {
+ TAILQ_FOREACH(current, &all_clients, clients) {
/* see if this client is interested in this event */
bool interested = false;
for (int i = 0; i < current->num_events; i++) {
ystr("name");
if (con->window && con->window->name)
ystr(i3string_as_utf8(con->window->name));
- else
+ else if (con->name != NULL)
ystr(con->name);
+ else
+ y(null);
if (con->type == CT_WORKSPACE) {
ystr("num");
y(array_open);
Con *node;
if (con->type != CT_DOCKAREA || !inplace_restart) {
- TAILQ_FOREACH (node, &(con->nodes_head), nodes) {
+ TAILQ_FOREACH(node, &(con->nodes_head), nodes) {
dump_node(gen, node, inplace_restart);
}
}
ystr("floating_nodes");
y(array_open);
- TAILQ_FOREACH (node, &(con->floating_head), floating_windows) {
+ TAILQ_FOREACH(node, &(con->floating_head), floating_windows) {
dump_node(gen, node, inplace_restart);
}
y(array_close);
ystr("focus");
y(array_open);
- TAILQ_FOREACH (node, &(con->focus_head), focused) {
+ TAILQ_FOREACH(node, &(con->focus_head), focused) {
y(integer, (long int)node);
}
y(array_close);
ystr("swallows");
y(array_open);
Match *match;
- TAILQ_FOREACH (match, &(con->swallow_head), matches) {
+ TAILQ_FOREACH(match, &(con->swallow_head), matches) {
y(map_open);
if (match->dock != -1) {
ystr("dock");
break;
}
+ if (config->wheel_up_cmd) {
+ ystr("wheel_up_cmd");
+ ystr(config->wheel_up_cmd);
+ }
+
+ if (config->wheel_down_cmd) {
+ ystr("wheel_down_cmd");
+ ystr(config->wheel_down_cmd);
+ }
+
ystr("position");
if (config->position == P_BOTTOM)
ystr("bottom");
Con *focused_ws = con_get_workspace(focused);
Con *output;
- TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
+ TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
if (con_is_internal(output))
continue;
Con *ws;
- TAILQ_FOREACH (ws, &(output_get_content(output)->nodes_head), nodes) {
+ TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) {
assert(ws->type == CT_WORKSPACE);
y(map_open);
y(array_open);
Output *output;
- TAILQ_FOREACH (output, &outputs, outputs) {
+ TAILQ_FOREACH(output, &outputs, outputs) {
y(map_open);
ystr("name");
y(array_open);
Con *con;
- TAILQ_FOREACH (con, &all_cons, all_cons)
- if (con->mark != NULL)
- ystr(con->mark);
+ TAILQ_FOREACH(con, &all_cons, all_cons)
+ if (con->mark != NULL)
+ ystr(con->mark);
y(array_close);
if (message_size == 0) {
y(array_open);
Barconfig *current;
- TAILQ_FOREACH (current, &barconfigs, configs) {
+ TAILQ_FOREACH(current, &barconfigs, configs) {
ystr(current->id);
}
y(array_close);
strncpy(bar_id, (const char *)message, message_size);
LOG("IPC: looking for config for bar ID \"%s\"\n", bar_id);
Barconfig *current, *config = NULL;
- TAILQ_FOREACH (current, &barconfigs, configs) {
+ TAILQ_FOREACH(current, &barconfigs, configs) {
if (strcmp(current->id, bar_id) != 0)
continue;
ipc_client *current, *client = NULL;
/* Search the ipc_client structure for this connection */
- TAILQ_FOREACH (current, &all_clients, clients) {
+ TAILQ_FOREACH(current, &all_clients, clients) {
if (current->fd != fd)
continue;
/* Delete the client from the list of clients */
ipc_client *current;
- TAILQ_FOREACH (current, &all_clients, clients) {
+ TAILQ_FOREACH(current, &all_clients, clients) {
if (current->fd != w->fd)
continue;