list_windows(rsp);
return;
} else if (strcmp(cmd, "list_history") == 0) {
- list_history(mon->desk, rsp);
+ char *name = strtok(NULL, TOK_SEP);
+ if (name != NULL) {
+ desktop_location_t loc;
+ if (locate_desktop(name, &loc))
+ list_history(loc.desktop, rsp);
+ } else {
+ list_history(mon->desk, rsp);
+ }
+ return;
} else if (strcmp(cmd, "list_rules") == 0) {
list_rules(rsp);
return;
if (parse_flip(flp, &f))
flip_tree(mon->desk->root, f);
}
+ } else if (strcmp(cmd, "balance") == 0) {
+ balance_tree(mon->desk->root);
} else if (strcmp(cmd, "grab_pointer") == 0) {
char *pac = strtok(NULL, TOK_SEP);
if (pac != NULL) {
char *dir = strtok(NULL, TOK_SEP);
if (dir != NULL) {
direction_t d;
- if (parse_direction(dir, &d)) {
+ if (parse_direction(dir, &d))
swap_nodes(mon->desk->focus, find_neighbor(mon->desk->focus, d));
- }
}
} else if (strcmp(cmd, "toggle_fullscreen") == 0) {
if (mon->desk->focus != NULL)
if (parse_send_option(opt, &o) && o == SEND_OPTION_FOLLOW)
select_monitor(m);
}
- }
+ }
} else if (strcmp(cmd, "drop_to") == 0) {
char *dir = strtok(NULL, TOK_SEP);
if (dir != NULL) {
if (name != NULL) {
desktop_location_t loc;
if (locate_desktop(name, &loc)) {
- if (loc.desktop == mon->desk) {
+ if (auto_alternate && loc.desktop == mon->desk) {
select_desktop(mon->last_desk);
} else {
select_monitor(loc.monitor);
while (arg != NULL) {
if (strcmp(arg, "floating") == 0) {
rule->effect.floating = true;
+ } else if (strcmp(arg, "follow") == 0) {
+ rule->effect.follow = true;
} else {
desktop_location_t loc;
if (locate_desktop(arg, &loc)) {
remove_rule_by_uid(uid);
return;
} else if (strcmp(cmd, "swap") == 0) {
- swap_nodes(mon->desk->focus, mon->desk->last_focus);
+ char *arg;
+ swap_arg_t a;
+ if ((arg = strtok(NULL, TOK_SEP)) != NULL) {
+ if (parse_swap_argument(arg, &a)) {
+ node_t *n = find_by_area(mon->desk, a);
+ swap_nodes(mon->desk->focus, n);
+ }
+ } else {
+ swap_nodes(mon->desk->focus, history_get(mon->desk->history, 1));
+ }
} else if (strcmp(cmd, "alternate") == 0) {
- node_list_t *a = mon->desk->focus_history->head->prev;
- if (a != NULL)
- focus_node(mon, mon->desk, a->node, true);
+ focus_node(mon, mon->desk, history_get(mon->desk->history, 1), true);
return;
} else if (strcmp(cmd, "alternate_desktop") == 0) {
select_desktop(mon->last_desk);
}
if (mon->desk->layout == LAYOUT_TILED)
return;
+ } else if (strcmp(cmd, "put_status") == 0) {
+ put_status();
} else if (strcmp(cmd, "adopt_orphans") == 0) {
adopt_orphans();
- } else if (strcmp(cmd, "reload_autostart") == 0) {
- run_autostart();
- } else if (strcmp(cmd, "reload_settings") == 0) {
- load_settings();
} else if (strcmp(cmd, "restore") == 0) {
char *arg = strtok(NULL, TOK_SEP);
restore(arg);
sscanf(value, "%u", &border_width);
} else if (strcmp(name, "window_gap") == 0) {
sscanf(value, "%i", &window_gap);
+ } else if (strcmp(name, "split_ratio") == 0) {
+ sscanf(value, "%lf", &split_ratio);
} else if (strcmp(name, "left_padding") == 0) {
sscanf(value, "%i", &mon->left_padding);
} else if (strcmp(name, "right_padding") == 0) {
gapless_monocle = b;
} else if (strcmp(name, "focus_follows_pointer") == 0) {
bool b;
- if (parse_bool(value, &b)) {
- if (b != focus_follows_pointer) {
- uint32_t values[] = {(focus_follows_pointer ? CLIENT_EVENT_MASK : CLIENT_EVENT_MASK_FFP)};
- for (monitor_t *m = mon_head; m != NULL; m = m->next)
- for (desktop_t *d = m->desk_head; d != NULL; d = d->next)
- for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n))
- xcb_change_window_attributes(dpy, n->client->window, XCB_CW_EVENT_MASK, values);
-
- }
+ if (parse_bool(value, &b) && b != focus_follows_pointer) {
+ uint32_t values[] = {(focus_follows_pointer ? CLIENT_EVENT_MASK : CLIENT_EVENT_MASK_FFP)};
+ for (monitor_t *m = mon_head; m != NULL; m = m->next)
+ for (desktop_t *d = m->desk_head; d != NULL; d = d->next)
+ for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n))
+ xcb_change_window_attributes(dpy, n->client->window, XCB_CW_EVENT_MASK, values);
+ if (focus_follows_pointer)
+ disable_motion_recorder();
+ else
+ enable_motion_recorder();
focus_follows_pointer = b;
}
} else if (strcmp(name, "adaptative_raise") == 0) {
bool b;
if (parse_bool(value, &b))
apply_shadow_property = b;
+ } else if (strcmp(name, "auto_alternate") == 0) {
+ bool b;
+ if (parse_bool(value, &b))
+ auto_alternate = b;
} else if (strcmp(name, "wm_name") == 0) {
strncpy(wm_name, value, sizeof(wm_name));
ewmh_update_wm_name();
snprintf(rsp, BUFSIZ, "%u", border_width);
else if (strcmp(name, "window_gap") == 0)
snprintf(rsp, BUFSIZ, "%i", window_gap);
+ else if (strcmp(name, "split_ratio") == 0)
+ snprintf(rsp, BUFSIZ, "%lf", split_ratio);
else if (strcmp(name, "left_padding") == 0)
snprintf(rsp, BUFSIZ, "%i", mon->left_padding);
else if (strcmp(name, "right_padding") == 0)
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(adaptative_raise));
else if (strcmp(name, "apply_shadow_property") == 0)
snprintf(rsp, BUFSIZ, "%s", BOOLSTR(apply_shadow_property));
+ else if (strcmp(name, "auto_alternate") == 0)
+ snprintf(rsp, BUFSIZ, "%s", BOOLSTR(auto_alternate));
else if (strcmp(name, "wm_name") == 0)
snprintf(rsp, BUFSIZ, "%s", wm_name);
else
return false;
}
+bool parse_swap_argument(char *s, swap_arg_t *a)
+{
+ if (strcmp(s, "biggest") == 0) {
+ *a = SWAP_BIGGEST;
+ return true;
+ } else if (strcmp(s, "smallest") == 0) {
+ *a = SWAP_SMALLEST;
+ return true;
+ }
+ return false;
+}
+
bool parse_cycle_direction(char *s, cycle_dir_t *d)
{
if (strcmp(s, "prev") == 0) {