diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/sway/commands.c b/sway/commands.c index 9a3ea5d6..1ca5c17f 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -282,8 +282,27 @@ static bool cmd_focus_follows_mouse(struct sway_config *config, int argc, char * | |||
282 | } | 282 | } |
283 | 283 | ||
284 | static bool cmd_move(struct sway_config *config, int argc, char **argv) { | 284 | static bool cmd_move(struct sway_config *config, int argc, char **argv) { |
285 | sway_log(L_DEBUG, "move cmd stub called");//Stubbed method until I get back. | 285 | if (!checkarg(argc, "workspace", EXPECTED_EQUAL_TO, 1)) { |
286 | return false; | ||
287 | } | ||
288 | |||
289 | swayc_t *view = get_focused_container(&root_container); | ||
290 | |||
291 | if (strcasecmp(argv[0], "left") == 0) { | ||
292 | move_container(view,&root_container,MOVE_LEFT); | ||
293 | } else if (strcasecmp(argv[0], "right") == 0) { | ||
294 | move_container(view,&root_container,MOVE_RIGHT); | ||
295 | } else if (strcasecmp(argv[0], "up") == 0) { | ||
296 | move_container(view,&root_container,MOVE_UP); | ||
297 | } else if (strcasecmp(argv[0], "down") == 0) { | ||
298 | move_container(view,&root_container,MOVE_DOWN); | ||
299 | } else | ||
300 | { | ||
301 | return false; | ||
302 | } | ||
303 | |||
286 | return true; | 304 | return true; |
305 | |||
287 | } | 306 | } |
288 | 307 | ||
289 | static bool cmd_kill(struct sway_config *config, int argc, char **argv) { | 308 | static bool cmd_kill(struct sway_config *config, int argc, char **argv) { |
@@ -492,13 +511,13 @@ static struct cmd_handler handlers[] = { | |||
492 | { "kill", cmd_kill }, | 511 | { "kill", cmd_kill }, |
493 | { "layout", cmd_layout }, | 512 | { "layout", cmd_layout }, |
494 | { "log_colors", cmd_log_colors }, | 513 | { "log_colors", cmd_log_colors }, |
514 | { "move",cmd_move}, | ||
495 | { "reload", cmd_reload }, | 515 | { "reload", cmd_reload }, |
496 | { "set", cmd_set }, | 516 | { "set", cmd_set }, |
497 | { "split", cmd_split }, | 517 | { "split", cmd_split }, |
498 | { "splith", cmd_splith }, | 518 | { "splith", cmd_splith }, |
499 | { "splitv", cmd_splitv }, | 519 | { "splitv", cmd_splitv }, |
500 | { "workspace", cmd_workspace }, | 520 | { "workspace", cmd_workspace } |
501 | { "cmd_move",cmd_move} | ||
502 | }; | 521 | }; |
503 | 522 | ||
504 | static char **split_directive(char *line, int *argc) { | 523 | static char **split_directive(char *line, int *argc) { |