]> git.lizzy.rs Git - bspwm.git/commitdiff
Allow cycling the splitting type of a node
authorEmanuele Torre <torreemanuele6@gmail.com>
Mon, 26 Jul 2021 16:10:08 +0000 (18:10 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Tue, 15 Feb 2022 10:12:11 +0000 (11:12 +0100)
doc/bspwm.1
doc/bspwm.1.asciidoc
src/messages.c

index 59b0faa59a7471be2a1cf1b65efed98d49b9a942..9863c2d5e37bd31d431bbf124120ab17df475028 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: bspwm
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 06/01/2021
+.\"      Date: 02/15/2022
 .\"    Manual: Bspwm Manual
-.\"    Source: Bspwm 0.9.10-31-ge21ab5b
+.\"    Source: Bspwm 0.9.10-34-g3403bb2
 .\"  Language: English
 .\"
-.TH "BSPWM" "1" "06/01/2021" "Bspwm 0\&.9\&.10\-31\-ge21ab5b" "Bspwm Manual"
+.TH "BSPWM" "1" "02/15/2022" "Bspwm 0\&.9\&.10\-34\-g3403bb2" "Bspwm Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -706,9 +706,9 @@ pixels horizontally and
 pixels vertically\&.
 .RE
 .PP
-\fB\-y\fR, \fB\-\-type\fR \fIhorizontal|vertical\fR
+\fB\-y\fR, \fB\-\-type\fR \fICYCLE_DIR\fR|horizontal|vertical
 .RS 4
-Set the splitting type of the selected node\&.
+Set or cycle the splitting type of the selected node\&.
 .RE
 .PP
 \fB\-r\fR, \fB\-\-ratio\fR \fIRATIO\fR|(+|\-)(\fIPIXELS\fR|\fIFRACTION\fR)
index 6e86413a799aed040d5756df4063ae3268a125f9..e84150bfbffa679ec73ef169d1fb57d22e0138ec 100644 (file)
@@ -434,8 +434,8 @@ Commands
 *-z*, *--resize* top|left|bottom|right|top_left|top_right|bottom_right|bottom_left 'dx' 'dy'::
        Resize the selected window by moving the given handle by 'dx' pixels horizontally and 'dy' pixels vertically.
 
-*-y*, *--type* 'horizontal|vertical'::
-       Set the splitting type of the selected node.
+*-y*, *--type* 'CYCLE_DIR'|horizontal|vertical::
+       Set or cycle the splitting type of the selected node.
 
 *-r*, *--ratio* 'RATIO'|(+|-)('PIXELS'|'FRACTION')::
        Set the splitting ratio of the selected node (0 < 'RATIO' < 1).
index bca55c99fbf8b3842053019b06b6e41a010f06f4..c3a42014db6e2f25bd7fd42cdf03ddd25de4f802 100644 (file)
@@ -468,14 +468,17 @@ void cmd_node(char **args, int num, FILE *rsp)
                                fail(rsp, "");
                                break;
                        }
+                       cycle_dir_t cyc;
                        split_type_t typ;
-                       if (parse_split_type(*args, &typ)) {
+                       if (parse_cycle_direction(*args, &cyc)) {
+                               set_type(trg.node, (trg.node->split_type + 1) % 2);
+                       } else if (parse_split_type(*args, &typ)) {
                                set_type(trg.node, typ);
-                               changed = true;
                        } else {
                                fail(rsp, "");
                                break;
                        }
+                       changed = true;
                } else if (streq("-r", *args) || streq("--ratio", *args)) {
                        num--, args++;
                        if (num < 1) {