rotate clockwise|counter_clockwise|full_cycle
Rotate the tree of the current desktop.
- magnetise top_left|top_right|bottom_left|bottom_right
- Move all the fences toward the given corner.
-
rule PATTERN floating
Make a new rule that will float the windows whose class name or instance name equals PATTERN.
.BI rotate " clockwise|counter_clockwise|full_cycle"
Rotate the tree of the current desktop.
.TP
-.BI magnetise " top_left|top_right|bottom_left|bottom_right"
-Move all the fences toward the given corner.
-.TP
.BI rule " PATTERN floating "
Make a new rule that will float the windows whose class name or instance name equals PATTERN.
.TP
return;
} else if (strcmp(cmd, "kill") == 0) {
window_kill(mon->desk, mon->desk->focus);
- } else if (strcmp(cmd, "magnetise") == 0) {
- char *cor = strtok(NULL, TOKEN_SEP);
- if (cor != NULL) {
- corner_t c;
- if (parse_corner(cor, &c)) {
- magnetise_tree(mon->desk->root, c);
- }
- }
} else if (strcmp(cmd, "rotate") == 0) {
char *deg = strtok(NULL, TOKEN_SEP);
if (deg != NULL) {
return false;
}
-bool parse_corner(char *s, corner_t *c)
-{
- if (strcmp(s, "top_left") == 0) {
- *c = TOP_LEFT;
- return true;
- } else if (strcmp(s, "top_right") == 0) {
- *c = TOP_RIGHT;
- return true;
- } else if (strcmp(s, "bottom_left") == 0) {
- *c = BOTTOM_LEFT;
- return true;
- } else if (strcmp(s, "bottom_right") == 0) {
- *c = BOTTOM_RIGHT;
- return true;
- }
- return false;
-}
-
bool parse_rotate(char *s, rotate_t *r)
{
if (strcmp(s, "clockwise") == 0) {
bool parse_list_option(char *, list_option_t *);
bool parse_skip_client(char *, skip_client_t *);
bool parse_skip_desktop(char *, skip_desktop_t *);
-bool parse_corner(char *, corner_t *);
bool parse_rotate(char *, rotate_t *);
bool parse_fence_move(char *, fence_move_t *);
bool parse_modifier_mask(char *, unsigned int *);
rotate_tree(n->second_child, rot);
}
-void magnetise_tree(node_t *n, corner_t corner)
-{
- if (n == NULL || is_leaf(n))
- return;
-
- PUTS("magnetise tree");
-
- switch (n->split_type) {
- case TYPE_HORIZONTAL:
- if (corner == TOP_LEFT || corner == TOP_RIGHT)
- change_split_ratio(n, CHANGE_DECREASE);
- else
- change_split_ratio(n, CHANGE_INCREASE);
- break;
- case TYPE_VERTICAL:
- if (corner == TOP_LEFT || corner == BOTTOM_LEFT)
- change_split_ratio(n, CHANGE_DECREASE);
- else
- change_split_ratio(n, CHANGE_INCREASE);
- break;
- default:
- break;
- }
-
- magnetise_tree(n->first_child, corner);
- magnetise_tree(n->second_child, corner);
-}
-
void dump_tree(desktop_t *d, node_t *n, char *rsp, unsigned int depth)
{
if (n == NULL)
node_t *find_neighbor(node_t *, direction_t);
void move_fence(node_t *, direction_t, fence_move_t);
void rotate_tree(node_t *, rotate_t);
-void magnetise_tree(node_t *, corner_t);
void arrange(monitor_t *, desktop_t *);
void apply_layout(monitor_t *, desktop_t *, node_t *, xcb_rectangle_t, xcb_rectangle_t);
void insert_node(monitor_t *, desktop_t *, node_t *);