summaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 9a90fe5f..1825be4f 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -800,26 +800,36 @@ 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 if (workspace_by_name(prev_workspace_name)) {
826 workspace_switch(workspace_by_name(prev_workspace_name));
827 } else {
828 workspace_switch(workspace_create(prev_workspace_name));
829 }
830 }
831 return true;
832 }
823 833
824 swayc_t *workspace = workspace_by_name(argv[0]); 834 swayc_t *workspace = workspace_by_name(argv[0]);
825 if (!workspace) { 835 if (!workspace) {