]> git.lizzy.rs Git - bspwm.git/commitdiff
New setting: `split_ratio`
authorBastien Dejean <nihilhill@gmail.com>
Wed, 3 Apr 2013 10:19:01 +0000 (12:19 +0200)
committerBastien Dejean <nihilhill@gmail.com>
Wed, 3 Apr 2013 10:19:01 +0000 (12:19 +0200)
README.md
bspwm.1
messages.c
settings.c
settings.h
types.c
types.h

index d7f968298f17bb74c0a1473f79d1c87fd672747d..2739019973038b5fbafc877f568f56eb2e4648b0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -203,6 +203,8 @@ Colors are either [X color names](http://en.wikipedia.org/wiki/X11_color_names)
 
 - `window_gap` — Value of the gap that separates windows.
 
+- `split_ratio` — Default split ratio.
+
 - `{top,right,bottom,left}_padding` — Padding space added at the sides of the current monitor.
 
 - `wm_name` — The value that shall be used for the `_NET_WM_NAME` property of the root window.
diff --git a/bspwm.1 b/bspwm.1
index 2bccf8b281ab834430e82aebf14bfcb026ec723d..97b69117dabbed2a4b1be454b1d544988d696efb 100644 (file)
--- a/bspwm.1
+++ b/bspwm.1
@@ -295,6 +295,9 @@ Window border width.
 .I window_gap
 Value of the gap that separates windows.
 .TP
+.I split_ratio
+Default split ratio.
+.TP
 .I top_padding
 .TQ
 .I right_padding
index 758e04b87cd1a4bfdbc36d9d2b81f8892024d7a0..8e7d9fb16c43ef0dddc1b2c13c37a5b1af20acb6 100644 (file)
@@ -460,6 +460,8 @@ void set_setting(char *name, char *value, char *rsp)
         sscanf(value, "%u", &border_width);
     } else if (strcmp(name, "window_gap") == 0) {
         sscanf(value, "%i", &window_gap);
+    } else if (strcmp(name, "split_ratio") == 0) {
+        sscanf(value, "%lf", &split_ratio);
     } else if (strcmp(name, "left_padding") == 0) {
         sscanf(value, "%i", &mon->left_padding);
     } else if (strcmp(name, "right_padding") == 0) {
@@ -547,6 +549,8 @@ void get_setting(char *name, char* rsp)
         snprintf(rsp, BUFSIZ, "%u", border_width);
     else if (strcmp(name, "window_gap") == 0)
         snprintf(rsp, BUFSIZ, "%i", window_gap);
+    else if (strcmp(name, "split_ratio") == 0)
+        snprintf(rsp, BUFSIZ, "%lf", split_ratio);
     else if (strcmp(name, "left_padding") == 0)
         snprintf(rsp, BUFSIZ, "%i", mon->left_padding);
     else if (strcmp(name, "right_padding") == 0)
index 2f1d96ae6370e62d943845c20e7a21d3cf195c1b..465e0182834671289a137b994b40acf7789c2da5 100644 (file)
@@ -58,6 +58,7 @@ void load_settings(void)
 
     border_width = BORDER_WIDTH;
     window_gap = WINDOW_GAP;
+    split_ratio = SPLIT_RATIO;
 
     borderless_monocle = BORDERLESS_MONOCLE;
     gapless_monocle = GAPLESS_MONOCLE;
index 30482e2355da9f53ea8a87d22f498dcfa42da83b..c4a4d1c07334429c00bbf800576a37e62d07212a 100644 (file)
@@ -47,6 +47,7 @@ uint32_t urgent_border_color_pxl;
 
 unsigned int border_width;
 int window_gap;
+double split_ratio;
 
 bool borderless_monocle;
 bool gapless_monocle;
diff --git a/types.c b/types.c
index 250785dc09c552da8e3f2e9510f77fc0c60f1fda..e675aad2877a9794b2cfa8fe35c90e9bd41047d2 100644 (file)
--- a/types.c
+++ b/types.c
@@ -12,7 +12,7 @@ node_t *make_node(void)
 {
     node_t *n = malloc(sizeof(node_t));
     n->parent = n->first_child = n->second_child = NULL;
-    n->split_ratio = SPLIT_RATIO;
+    n->split_ratio = split_ratio;
     n->split_type = TYPE_VERTICAL;
     n->client = NULL;
     n->vacant = false;
diff --git a/types.h b/types.h
index 94e7aca9e144d9ffdd79e667c488b0c81bad7ffd..589e76892ac3d026fbf25447689ba01c9756c082 100644 (file)
--- a/types.h
+++ b/types.h
@@ -6,7 +6,6 @@
 #include <xcb/xcb_event.h>
 #include "helpers.h"
 
-#define SPLIT_RATIO  0.5
 #define DEFAULT_DESK_NAME    "Desktop"
 #define DEFAULT_MON_NAME     "Monitor"
 #define MISSING_VALUE        "N/A"