Added Awesome/Monad type "auto" layouts

This commit is contained in:
wil 2016-12-10 16:44:43 +01:00
parent 6a1df17fb7
commit 97f7d47413
7 changed files with 372 additions and 113 deletions

View file

@ -54,6 +54,26 @@ struct cmd_results *cmd_layout(int argc, char **argv) {
} else {
swayc_change_layout(parent, L_HORIZ);
}
} else if (strcasecmp(argv[0], "auto_left") == 0) {
if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){
parent = new_container(parent, L_AUTO_LEFT);
}
swayc_change_layout(parent, L_AUTO_LEFT);
} else if (strcasecmp(argv[0], "auto_right") == 0) {
if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){
parent = new_container(parent, L_AUTO_RIGHT);
}
swayc_change_layout(parent, L_AUTO_RIGHT);
} else if (strcasecmp(argv[0], "auto_top") == 0) {
if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){
parent = new_container(parent, L_AUTO_TOP);
}
swayc_change_layout(parent, L_AUTO_TOP);
} else if (strcasecmp(argv[0], "auto_bot") == 0) {
if (parent->type != C_CONTAINER && !swayc_is_empty_workspace(parent)){
parent = new_container(parent, L_AUTO_BOTTOM);
}
swayc_change_layout(parent, L_AUTO_BOTTOM);
}
}