|
|
@ -99,11 +99,24 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
|
|
|
|
if (strcasecmp(argv[1], "workspace") == 0) {
|
|
|
|
if (strcasecmp(argv[1], "workspace") == 0) {
|
|
|
|
// move container to workspace x
|
|
|
|
// move container to workspace x
|
|
|
|
struct sway_container *ws;
|
|
|
|
struct sway_container *ws;
|
|
|
|
|
|
|
|
if (strcasecmp(argv[2], "next") == 0 ||
|
|
|
|
|
|
|
|
strcasecmp(argv[2], "prev") == 0 ||
|
|
|
|
|
|
|
|
strcasecmp(argv[2], "next_on_output") == 0 ||
|
|
|
|
|
|
|
|
strcasecmp(argv[2], "prev_on_output") == 0 ||
|
|
|
|
|
|
|
|
strcasecmp(argv[2], "back_and_forth") == 0 ||
|
|
|
|
|
|
|
|
strcasecmp(argv[2], "current") == 0) {
|
|
|
|
|
|
|
|
ws = workspace_by_name(argv[2]);
|
|
|
|
|
|
|
|
} else if (strcasecmp(argv[2], "back_and_forth") == 0) {
|
|
|
|
|
|
|
|
if (!(ws = workspace_by_name(argv[0])) && prev_workspace_name) {
|
|
|
|
|
|
|
|
ws = workspace_create(NULL, prev_workspace_name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
char *ws_name = NULL;
|
|
|
|
char *ws_name = NULL;
|
|
|
|
if (strcasecmp(argv[2], "number") == 0) {
|
|
|
|
if (strcasecmp(argv[2], "number") == 0) {
|
|
|
|
// move "container to workspace number x"
|
|
|
|
// move "container to workspace number x"
|
|
|
|
if (argc < 4) {
|
|
|
|
if (argc < 4) {
|
|
|
|
return cmd_results_new(CMD_INVALID, "move", expected_syntax);
|
|
|
|
return cmd_results_new(CMD_INVALID, "move",
|
|
|
|
|
|
|
|
expected_syntax);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ws_name = strdup(argv[3]);
|
|
|
|
ws_name = strdup(argv[3]);
|
|
|
|
ws = workspace_by_number(ws_name);
|
|
|
|
ws = workspace_by_number(ws_name);
|
|
|
@ -124,15 +137,10 @@ static struct cmd_results *cmd_move_container(struct sway_container *current,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!ws) {
|
|
|
|
if (!ws) {
|
|
|
|
if (strcasecmp(argv[2], "back_and_forth") == 0) {
|
|
|
|
|
|
|
|
if (prev_workspace_name) {
|
|
|
|
|
|
|
|
ws = workspace_create(NULL, prev_workspace_name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
ws = workspace_create(NULL, ws_name);
|
|
|
|
ws = workspace_create(NULL, ws_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(ws_name);
|
|
|
|
free(ws_name);
|
|
|
|
|
|
|
|
}
|
|
|
|
destination = seat_get_focus_inactive(config->handler_context.seat, ws);
|
|
|
|
destination = seat_get_focus_inactive(config->handler_context.seat, ws);
|
|
|
|
} else if (strcasecmp(argv[1], "output") == 0) {
|
|
|
|
} else if (strcasecmp(argv[1], "output") == 0) {
|
|
|
|
struct sway_container *source = container_parent(current, C_OUTPUT);
|
|
|
|
struct sway_container *source = container_parent(current, C_OUTPUT);
|
|
|
|