]> git.lizzy.rs Git - bspwm.git/commitdiff
New message: `fence_ratio`
authorBastien Dejean <nihilhill@gmail.com>
Sat, 22 Jun 2013 10:13:35 +0000 (12:13 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Sat, 22 Jun 2013 10:13:35 +0000 (12:13 +0200)
README.md
bash_completion
bspwm.1
messages.c

index cc49d655079532727a1b364207de9bfdbc3c82bd..b39f1465507589ddb9955bd6dd8c44d99bf6491a 100644 (file)
--- a/README.md
+++ b/README.md
@@ -113,6 +113,8 @@ The following messages are handled:
 
 - `pull left|right|up|down` — Pull the fence located in the given direction.
 
+- `fence_ratio left|right|up|down VALUE` — Set the splitting ratio of the fence located in the given direction.
+
 - `cycle next|prev [--skip-floating|--skip-tiled|--skip-class-equal|--skip-class-differ]` — Focus the next or previous window matching the given constraints.
 
 - `nearest older|newer [--skip-floating|--skip-tiled|--skip-class-equal|--skip-class-differ]` — Focus the nearest window matching the given constraints.
index 3fa02cdb9a16617147ecd5b6f6508e00a2c86348..f51024714201f6e68e606919a95a930dfadbec6f 100644 (file)
@@ -1,6 +1,6 @@
 _bspc()
 {
-    local messages='get set list list_desktops list_monitors list_windows list_rules list_history presel cancel ratio pad focus shift swap push pull cycle nearest biggest circulate grab_pointer track_pointer ungrab_pointer toggle_fullscreen toggle_floating toggle_locked toggle_visibility close kill send_to drop_to send_to_monitor drop_to_monitor use use_monitor alternate alternate_desktop alternate_monitor add add_in rename_monitor rename remove_desktop send_desktop_to cycle_monitor cycle_desktop layout cycle_layout rotate flip balance rule remove_rule put_status adopt_orphans restore_layout restore_history quit'
+    local messages='get set list list_desktops list_monitors list_windows list_rules list_history presel cancel ratio pad focus shift swap push pull fence_ratio cycle nearest biggest circulate grab_pointer track_pointer ungrab_pointer toggle_fullscreen toggle_floating toggle_locked toggle_visibility close kill send_to drop_to send_to_monitor drop_to_monitor use use_monitor alternate alternate_desktop alternate_monitor add add_in rename_monitor rename remove_desktop send_desktop_to cycle_monitor cycle_desktop layout cycle_layout rotate flip balance rule remove_rule put_status adopt_orphans restore_layout restore_history quit'
 
     local settings='focused_border_color active_border_color normal_border_color presel_border_color focused_locked_border_color active_locked_border_color normal_locked_border_color urgent_border_color border_width window_gap split_ratio top_padding right_padding bottom_padding left_padding wm_name borderless_monocle gapless_monocle focus_follows_pointer pointer_follows_monitor adaptative_raise apply_shadow_property auto_alternate focus_by_distance'
 
diff --git a/bspwm.1 b/bspwm.1
index 05a2306cf459e21ad9fe448cc266d7d22accde93..388b234aaf5e752ba47c2a0aa96ffccc794b87d8 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -147,6 +147,9 @@ Push the fence located in the given direction.
 .BI pull " left|right|up|down"
 Pull the fence located in the given direction.
 .TP
+.BI fence_ratio " left|right|up|down VALUE"
+Set the splitting ratio of the fence located in the given direction.
+.TP
 .BI cycle " next|prev [--skip-floating|--skip-tiled|--skip-class-equal|--skip-class-differ]"
 Focus the next or previous window matching the given constraints.
 .TP
index c6e933e895af07b9f03d7fc8c6be25127b356fc5..c22431047f99389fb83bc1af63dff78f3152e25d 100644 (file)
@@ -178,10 +178,22 @@ void process_message(char *msg, char *rsp)
         if (dir != NULL) {
             fence_move_t m;
             direction_t d;
-            if (parse_fence_move(cmd, &m) && parse_direction(dir, &d))
+            if (parse_fence_move(cmd, &m) && parse_direction(dir, &d)) {
                 move_fence(mon->desk->focus, d, m);
+                arrange(mon, mon->desk);
+            }
+        }
+    } else if (strcmp(cmd, "fence_ratio") == 0) {
+        char *dir = strtok(NULL, TOK_SEP);
+        if (dir != NULL) {
+            direction_t d;
+            node_t *n;
+            if (parse_direction(dir, &d) && (n = find_fence(mon->desk->focus, d)) != NULL) {
+                char *value = strtok(NULL, TOK_SEP);
+                if (sscanf(value, "%lf", &n->split_ratio) == 1)
+                    arrange(mon, mon->desk);
+            }
         }
-        arrange(mon, mon->desk);
     } else if (strcmp(cmd, "drop_to_monitor") == 0) {
         char *dir = strtok(NULL, TOK_SEP);
         if (dir != NULL) {