aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 3ac7f4dd..e39b781a 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -341,6 +341,28 @@ static bool cmd_focus_follows_mouse(struct sway_config *config, int argc, char *
return true;
}
+static bool cmd_move(struct sway_config *config, int argc, char **argv) {
+ if (!checkarg(argc, "workspace", EXPECTED_EQUAL_TO, 1)) {
+ return false;
+ }
+
+ swayc_t *view = get_focused_container(&root_container);
+
+ if (strcasecmp(argv[0], "left") == 0) {
+ move_container(view,&root_container,MOVE_LEFT);
+ } else if (strcasecmp(argv[0], "right") == 0) {
+ move_container(view,&root_container,MOVE_RIGHT);
+ } else if (strcasecmp(argv[0], "up") == 0) {
+ move_container(view,&root_container,MOVE_UP);
+ } else if (strcasecmp(argv[0], "down") == 0) {
+ move_container(view,&root_container,MOVE_DOWN);
+ } else
+ {
+ return false;
+ }
+
+ return true;
+
static bool cmd_gaps(struct sway_config *config, int argc, char **argv) {
if (!checkarg(argc, "gaps", EXPECTED_AT_LEAST, 1)) {
return false;
@@ -583,6 +605,7 @@ static struct cmd_handler handlers[] = {
{ "kill", cmd_kill },
{ "layout", cmd_layout },
{ "log_colors", cmd_log_colors },
+ { "move",cmd_move},
{ "reload", cmd_reload },
{ "set", cmd_set },
{ "split", cmd_split },