summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar wil <william.barsse@gmail.com>2017-01-14 19:34:04 +0100
committerLibravatar wil <william.barsse@gmail.com>2017-01-14 19:41:00 +0100
commit71b386964afa553cb2386a06304bfe55cdc25aa1 (patch)
treeafcca444fa5acb2a267ee7e573e684a965ee3f2a
parentImproved behavior of insert/remove child in auto layouts (diff)
downloadsway-71b386964afa553cb2386a06304bfe55cdc25aa1.tar.gz
sway-71b386964afa553cb2386a06304bfe55cdc25aa1.tar.zst
sway-71b386964afa553cb2386a06304bfe55cdc25aa1.zip
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 ff097fef..d04bb4dc 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 **
78 struct cmd_results *error = NULL; 78 struct cmd_results *error = NULL;
79 const char *cmd_name = "layout auto"; 79 const char *cmd_name = "layout auto";
80 const char *set_inc_cmd_name = "layout auto [master|ncol] [set|inc]"; 80 const char *set_inc_cmd_name = "layout auto [master|ncol] [set|inc]";
81 const char *err_msg = "Allowed arguments are <right|left|top|bot|next|prev|master|ncol>"; 81 const char *err_msg = "Allowed arguments are <right|left|top|bottom|next|prev|master|ncol>";
82 82
83 bool need_layout_update = false; 83 bool need_layout_update = false;
84 enum swayc_layouts old_layout = container->layout; 84 enum swayc_layouts old_layout = container->layout;
@@ -90,7 +90,7 @@ static struct cmd_results *cmd_layout_auto(swayc_t *container, int argc, char **
90 layout = L_AUTO_RIGHT; 90 layout = L_AUTO_RIGHT;
91 } else if (strcasecmp(argv[1], "top") == 0) { 91 } else if (strcasecmp(argv[1], "top") == 0) {
92 layout = L_AUTO_TOP; 92 layout = L_AUTO_TOP;
93 } else if (strcasecmp(argv[1], "bot") == 0) { 93 } else if (strcasecmp(argv[1], "bottom") == 0) {
94 layout = L_AUTO_BOTTOM; 94 layout = L_AUTO_BOTTOM;
95 } else if (strcasecmp(argv[1], "next") == 0) { 95 } else if (strcasecmp(argv[1], "next") == 0) {
96 if (is_auto_layout(container->layout) && container->layout < L_AUTO_LAST) { 96 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 3e0a12ce..c9305773 100644
--- a/sway/commands/workspace_layout.c
+++ b/sway/commands/workspace_layout.c
@@ -3,7 +3,7 @@
3 3
4struct cmd_results *cmd_workspace_layout(int argc, char **argv) { 4struct cmd_results *cmd_workspace_layout(int argc, char **argv) {
5 struct cmd_results *error = NULL; 5 struct cmd_results *error = NULL;
6 if ((error = checkarg(argc, "workspace_layout", EXPECTED_EQUAL_TO, 1))) { 6 if ((error = checkarg(argc, "workspace_layout", EXPECTED_AT_LEAST, 1))) {
7 return error; 7 return error;
8 } 8 }
9 9
@@ -13,16 +13,27 @@ struct cmd_results *cmd_workspace_layout(int argc, char **argv) {
13 config->default_layout = L_STACKED; 13 config->default_layout = L_STACKED;
14 } else if (strcasecmp(argv[0], "tabbed") == 0) { 14 } else if (strcasecmp(argv[0], "tabbed") == 0) {
15 config->default_layout = L_TABBED; 15 config->default_layout = L_TABBED;
16 } else if (strcasecmp(argv[0], "auto_left") == 0) { 16 } else if (strcasecmp(argv[0], "auto") == 0) {
17 config->default_layout = L_AUTO_LEFT; 17 if (argc == 1) {
18 } else if (strcasecmp(argv[0], "auto_right") == 0) { 18 config->default_layout = L_AUTO_FIRST;
19 config->default_layout = L_AUTO_RIGHT; 19 } else {
20 } else if (strcasecmp(argv[0], "auto_top") == 0) { 20 if ((error = checkarg(argc, "workspace_layout auto", EXPECTED_EQUAL_TO, 2))) {
21 config->default_layout = L_AUTO_TOP; 21 return error;
22 } else if (strcasecmp(argv[0], "auto_bottom") == 0) { 22 }
23 config->default_layout = L_AUTO_BOTTOM; 23 if (strcasecmp(argv[0], "left") == 0) {
24 config->default_layout = L_AUTO_LEFT;
25 } else if (strcasecmp(argv[0], "right") == 0) {
26 config->default_layout = L_AUTO_RIGHT;
27 } else if (strcasecmp(argv[0], "top") == 0) {
28 config->default_layout = L_AUTO_TOP;
29 } else if (strcasecmp(argv[0], "bottom") == 0) {
30 config->default_layout = L_AUTO_BOTTOM;
31 } else {
32 return cmd_results_new(CMD_INVALID, "workspace_layout auto", "Expected 'workspace_layout auto <left|right|top|bottom>'");
33 }
34 }
24 } else { 35 } else {
25 return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed|auto_left|auto_right|auto_top|auto_bottom>'"); 36 return cmd_results_new(CMD_INVALID, "workspace_layout", "Expected 'workspace_layout <default|stacking|tabbed|auto|auto left|auto right|auto top|auto bottom>'");
26 } 37 }
27 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 38 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
28} 39}
diff --git a/sway/sway.5.txt b/sway/sway.5.txt
index 5e0a07bd..ee1cbddd 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**(
64**focus** <direction>:: 64**focus** <direction>::
65 Direction may be one of _up_, _down_, _left_, _right_, _next_, _prev_, 65 Direction may be one of _up_, _down_, _left_, _right_, _next_, _prev_,
66 _parent_, or _child_. The directional focus commands will move the focus 66 _parent_, or _child_. The directional focus commands will move the focus
67 in that direction. The auto_next and auto_prev will focus the next, 67 in that direction. The _next_ and _prev_ directions will focus the next,
68 respectively previous, element in the current container if it is using 68 respectively previous, element in the current container. The parent
69 one of the _auto_ layouts. The parent focus command will change the 69 focus command will change the focus to the parent of the currently
70 focus to the parent of the currently focused container, which is useful, 70 focused container, which is useful, for example, to open a sibling of
71 for example, to open a sibling of the parent container, or to move the 71 the parent container, or to move the entire container around.
72 entire container around.
73 72
74**focus** output <direction|name>:: 73**focus** output <direction|name>::
75 Direction may be one of _up_, _down_, _left_, _right_. The directional focus 74 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**(
88 87
89**layout** auto <mode>:: 88**layout** auto <mode>::
90 Sets layout to one of the auto modes, i.e. one of _left_, right_, _top_, 89 Sets layout to one of the auto modes, i.e. one of _left_, right_, _top_,
91 or _bot_. 90 or _bottom_.
92 91
93**layout** auto <next|prev>:: 92**layout** auto <next|prev>::
94 Cycles between available auto layouts. 93 Cycles between available auto layouts.
@@ -381,8 +380,8 @@ The default colors are:
381 switch to workspace 2, then invoke the "workspace 2" command again, you 380 switch to workspace 2, then invoke the "workspace 2" command again, you
382 will be returned to workspace 1. Defaults to _no_. 381 will be returned to workspace 1. Defaults to _no_.
383 382
384**workspace_layout** <default|stacking|tabbed|auto_left|auto_right|auto_top|auto_bottom>:: 383**workspace_layout** <default|stacking|tabbed|auto|auto left|auto right|auto
385 Specifies the start layout for new workspaces. 384 top|auto bottom>:: Specifies the start layout for new workspaces.
386 385
387**include** <path>:: 386**include** <path>::
388 Includes a sub config file by _path_. _path_ can be either a full path or a 387 Includes a sub config file by _path_. _path_ can be either a full path or a