aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwil <william.barsse@gmail.com>2017-01-14 19:34:04 +0100
committerwil <william.barsse@gmail.com>2017-01-14 19:41:00 +0100
commit71b386964afa553cb2386a06304bfe55cdc25aa1 (patch)
treeafcca444fa5acb2a267ee7e573e684a965ee3f2a
parentb74870f51653872b36dd31fc76bdb738979e58a9 (diff)
downloadsway-71b386964afa553cb2386a06304bfe55cdc25aa1.zip
sway-71b386964afa553cb2386a06304bfe55cdc25aa1.tar.gz
sway-71b386964afa553cb2386a06304bfe55cdc25aa1.tar.bz2
replaced "bot" with "bottom" in auto layout commands
-rw-r--r--sway/commands/layout.c4
-rw-r--r--sway/commands/workspace_layout.c31
-rw-r--r--sway/sway.5.txt17
3 files changed, 31 insertions, 21 deletions
diff --git a/sway/commands/layout.c b/sway/commands/layout.c
index ff097fe..d04bb4d 100644
--- a/sway/commands/layout.c
+++ b/sway/commands/layout.c
@@ -78,7 +78,7 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char **
struct cmd_results *error = NULL;
const char *cmd_name = "layout auto";
const char *set_inc_cmd_name = "layout auto [master|ncol] [set|inc]";
- const char *err_msg = "Allowed arguments are <right|left|top|bot|next|prev|master|ncol>";
+ const char *err_msg = "Allowed arguments are <right|left|top|bottom|next|prev|master|ncol>";
bool need_layout_update = false;
enum swayc_layouts old_layout = container->layout;
@@ -90,7 +90,7 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char **
layout = L_AUTO_RIGHT;
} else if (strcasecmp(argv[1], "top") == 0) {
layout = L_AUTO_TOP;
- } else if (strcasecmp(argv[1], "bot") == 0) {
+ } else if (strcasecmp(argv[1], "bottom") == 0) {
layout = L_AUTO_BOTTOM;
} else if (strcasecmp(argv[1], "next") == 0) {
if (is_auto_layout(container->layout) && container->layout < L_AUTO_LAST) {
diff --git a/sway/commands/workspace_layout.c b/sway/commands/workspace_layout.c
index 3e0a12c..c930577 100644
--- a/sway/commands/workspace_layout.c
+++ b/sway/commands/workspace_layout.c
@@ -3,7 +3,7 @@
struct cmd_results *cmd_workspace_layout(int argc, char **argv) {
struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "workspace_layout", EXPECTED_EQUAL_TO, 1))) {
+ if ((error = checkarg(argc, "workspace_layout", EXPECTED_AT_LEAST, 1))) {
return error;
}
@@ -13,16 +13,27 @@ struct cmd_results *cmd_workspace_layout(int argc, char **argv) {
config->default_layout = L_STACKED;
} else if (strcasecmp(argv[0], "tabbed") == 0) {
config->default_layout = L_TABBED;
- } else if (strcasecmp(argv[0], "auto_left") == 0) {
- config->default_layout = L_AUTO_LEFT;
- } else if (strcasecmp(argv[0], "auto_right") == 0) {
- config->default_layout = L_AUTO_RIGHT;
- } else if (strcasecmp(argv[0], "auto_top") == 0) {
- config->default_layout = L_AUTO_TOP;
- } else if (strcasecmp(argv[0], "auto_bottom") == 0) {
- config->default_layout = L_AUTO_BOTTOM;
+ } else if (strcasecmp(argv[0], "auto") == 0) {
+ if (argc == 1) {
+ config->default_layout = L_AUTO_FIRST;
+ } else {
+ if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) {
+ return error;
+ }
+ if (strcasecmp(argv[0], "left") == 0) {
+ config->default_layout = L_AUTO_LEFT;
+ } else if (strcasecmp(argv[0], "right") == 0) {
+ config->default_layout = L_AUTO_RIGHT;
+ } else if (strcasecmp(argv[0], "top") == 0) {
+ config->default_layout = L_AUTO_TOP;
+ } else if (strcasecmp(argv[0], "bottom") == 0) {
+ config->default_layout = L_AUTO_BOTTOM;
+ } else {
+ return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'");
+ }
+ }
} else {
- return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed|auto_left|auto_right|auto_top|auto_bottom>'");
+ return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed|auto|auto left|auto right|auto top|auto bottom>'");
}
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 5e0a07b..ee1cbdd 100644
--- a/sway/sway.5.txt
+++ b/sway/sway.5.txt
@@ -64,12 +64,11 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
**focus** <direction>::
Direction may be one of _up_, _down_, _left_, _right_, _next_, _prev_,
_parent_, or _child_. The directional focus commands will move the focus
- in that direction. The auto_next and auto_prev will focus the next,
- respectively previous, element in the current container if it is using
- one of the _auto_ layouts. The parent focus command will change the
- focus to the parent of the currently focused container, which is useful,
- for example, to open a sibling of the parent container, or to move the
- entire container around.
+ in that direction. The _next_ and _prev_ directions will focus the next,
+ respectively previous, element in the current container. The parent
+ focus command will change the focus to the parent of the currently
+ focused container, which is useful, for example, to open a sibling of
+ the parent container, or to move the entire container around.
**focus** output <direction|name>::
Direction may be one of _up_, _down_, _left_, _right_. The directional focus
@@ -88,7 +87,7 @@ They are expected to be used with **bindsym** or at runtime through **swaymsg**(
**layout** auto <mode>::
Sets layout to one of the auto modes, i.e. one of _left_, right_, _top_,
- or _bot_.
+ or _bottom_.
**layout** auto <next|prev>::
Cycles between available auto layouts.
@@ -381,8 +380,8 @@ The default colors are:
switch to workspace 2, then invoke the "workspace 2" command again, you
will be returned to workspace 1. Defaults to _no_.
-**workspace_layout** <default|stacking|tabbed|auto_left|auto_right|auto_top|auto_bottom>::
- Specifies the start layout for new workspaces.
+**workspace_layout** <default|stacking|tabbed|auto|auto left|auto right|auto
+ top|auto bottom>:: Specifies the start layout for new workspaces.
**include** <path>::
Includes a sub config file by _path_. _path_ can be either a full path or a