]> Pileus Git - wmpus/blobdiff - wm-wmii.c
Use config for sys-x11 and wm-wmii
[wmpus] / wm-wmii.c
index ac1333325dfb656ceedc864148f747594623212b..aab29217d453ee6de3dd5523db07a55fd80d2881 100644 (file)
--- a/wm-wmii.c
+++ b/wm-wmii.c
 #include <stdlib.h>
 
 #include "util.h"
+#include "conf.h"
 #include "sys.h"
 #include "wm.h"
 
+/* Configuration */
 #ifndef MODKEY
 #define MODKEY alt
 #endif
-#ifndef MARGIN
-#define MARGIN 0
-#endif
-#ifndef STACK
-#define STACK  25
-#endif
+static int MARGIN = 0;
+static int STACK  = 25;
 
 /* Enums */
 typedef enum {
@@ -886,6 +884,10 @@ void wm_init(win_t *root)
 {
        printf("wm_init: %p\n", root);
 
+       /* Load configuration */
+       MARGIN = conf_get_int("main.margin", MARGIN);
+       STACK  = conf_get_int("main.stack",  STACK);
+
        /* Hack, fix screen order */
        list_t *screens = sys_info(root);
        list_t *left  = screens;