]> git.lizzy.rs Git - bspwm.git/commitdiff
Handle optional split ratio in 'presel'
authorBastien Dejean <nihilhill@gmail.com>
Fri, 21 Dec 2012 10:34:08 +0000 (11:34 +0100)
committerBastien Dejean <nihilhill@gmail.com>
Fri, 21 Dec 2012 10:34:08 +0000 (11:34 +0100)
README.md
bspwm.1
messages.c

index 213bfd2fcf7b3a2d20d10fb18fcbcde1afb1b0b7..6f844ba17c8fa4ec18bf257178916a37016ba55f 100644 (file)
--- a/README.md
+++ b/README.md
@@ -95,7 +95,7 @@ The following messages are handled:
     list_windows
         Return the list of managed windows (i.e. their identifiers).
 
-    presel left|right|up|down
+    presel left|right|up|down [SPLIT_RATIO]
         Switch to manual mode and select the splitting direction.
 
     cancel
diff --git a/bspwm.1 b/bspwm.1
index b2b182f78194b1ac6279a89caa22bd5faba5bcab..5d327217f8a22e005bfb7f0878c22f0fbf7d6f4e 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -116,7 +116,7 @@ Perform a dump of each monitor.
 .BI list_windows
 Return the list of managed windows (i.e. their identifiers).
 .TP
-.BI presel " left|right|up|down"
+.BI presel " left|right|up|down [SPLIT_RATIO]"
 Switch to manual mode and select the splitting direction.
 .TP
 .BI cancel
index d4468a8f8653b10fd037ac982ea598774832fba9..ea1bc1b008a9fb7137d4d131b1bebb143fb751e0 100644 (file)
@@ -142,6 +142,9 @@ void process_message(char *msg, char *rsp)
             if (parse_direction(dir, &d)) {
                 split_mode = MODE_MANUAL;
                 split_dir = d;
+                char *rat = strtok(NULL, TOK_SEP);
+                if (rat != NULL)
+                    sscanf(rat, "%lf", &mon->desk->focus->split_ratio);
                 window_draw_border(mon->desk->focus, true, true);
             }
         }