diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c index 9a90fe5f..caf8d928 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -800,26 +800,37 @@ static bool cmd_workspace(struct sway_config *config, int argc, char **argv) { | |||
800 | 800 | ||
801 | if (argc == 1) { | 801 | if (argc == 1) { |
802 | // Handle workspace next/prev | 802 | // Handle workspace next/prev |
803 | if (strcmp(argv[0], "next") == 0) { | 803 | if (strcasecmp(argv[0], "next") == 0) { |
804 | workspace_switch(workspace_next()); | 804 | workspace_switch(workspace_next()); |
805 | return true; | 805 | return true; |
806 | } | 806 | } |
807 | 807 | ||
808 | if (strcmp(argv[0], "prev") == 0) { | 808 | if (strcasecmp(argv[0], "prev") == 0) { |
809 | workspace_switch(workspace_prev()); | 809 | workspace_switch(workspace_prev()); |
810 | return true; | 810 | return true; |
811 | } | 811 | } |
812 | 812 | ||
813 | // Handle workspace output_next/prev | 813 | // Handle workspace output_next/prev |
814 | if (strcmp(argv[0], "next_on_output") == 0) { | 814 | if (strcasecmp(argv[0], "next_on_output") == 0) { |
815 | workspace_switch(workspace_output_next()); | 815 | workspace_switch(workspace_output_next()); |
816 | return true; | 816 | return true; |
817 | } | 817 | } |
818 | 818 | ||
819 | if (strcmp(argv[0], "prev_on_output") == 0) { | 819 | if (strcasecmp(argv[0], "prev_on_output") == 0) { |
820 | workspace_switch(workspace_output_prev()); | 820 | workspace_switch(workspace_output_prev()); |
821 | return true; | 821 | return true; |
822 | } | 822 | } |
823 | if (strcasecmp(argv[0], "back_and_forth") == 0) { | ||
824 | if (prev_workspace_name) { | ||
825 | sway_log(L_INFO, "Trying to switch to WS wtih name %s", prev_workspace_name); | ||
826 | if (workspace_by_name(prev_workspace_name)) { | ||
827 | workspace_switch(workspace_by_name(prev_workspace_name)); | ||
828 | } else { | ||
829 | workspace_switch(workspace_create(prev_workspace_name)); | ||
830 | } | ||
831 | } | ||
832 | return true; | ||
833 | } | ||
823 | 834 | ||
824 | swayc_t *workspace = workspace_by_name(argv[0]); | 835 | swayc_t *workspace = workspace_by_name(argv[0]); |
825 | if (!workspace) { | 836 | if (!workspace) { |