|
|
@ -800,26 +800,36 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) {
|
|
|
|
|
|
|
|
|
|
|
|
if (argc == 1) {
|
|
|
|
if (argc == 1) {
|
|
|
|
// Handle workspace next/prev
|
|
|
|
// Handle workspace next/prev
|
|
|
|
if (strcmp(argv[0], "next") == 0) {
|
|
|
|
if (strcasecmp(argv[0], "next") == 0) {
|
|
|
|
workspace_switch(workspace_next());
|
|
|
|
workspace_switch(workspace_next());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (strcmp(argv[0], "prev") == 0) {
|
|
|
|
if (strcasecmp(argv[0], "prev") == 0) {
|
|
|
|
workspace_switch(workspace_prev());
|
|
|
|
workspace_switch(workspace_prev());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Handle workspace output_next/prev
|
|
|
|
// Handle workspace output_next/prev
|
|
|
|
if (strcmp(argv[0], "next_on_output") == 0) {
|
|
|
|
if (strcasecmp(argv[0], "next_on_output") == 0) {
|
|
|
|
workspace_switch(workspace_output_next());
|
|
|
|
workspace_switch(workspace_output_next());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (strcmp(argv[0], "prev_on_output") == 0) {
|
|
|
|
if (strcasecmp(argv[0], "prev_on_output") == 0) {
|
|
|
|
workspace_switch(workspace_output_prev());
|
|
|
|
workspace_switch(workspace_output_prev());
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strcasecmp(argv[0], "back_and_forth") == 0) {
|
|
|
|
|
|
|
|
if (prev_workspace_name) {
|
|
|
|
|
|
|
|
if (workspace_by_name(prev_workspace_name)) {
|
|
|
|
|
|
|
|
workspace_switch(workspace_by_name(prev_workspace_name));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
workspace_switch(workspace_create(prev_workspace_name));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
swayc_t *workspace = workspace_by_name(argv[0]);
|
|
|
|
swayc_t *workspace = workspace_by_name(argv[0]);
|
|
|
|
if (!workspace) {
|
|
|
|
if (!workspace) {
|
|
|
|