]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/config.c
Merge branch 'master' into next
[i3/i3] / i3bar / src / config.c
index 567d0002e3768299c65df4927ae516f921c0442f..5ac31b1f3a16d53a3a2d2488377b7b22374c62fd 100644 (file)
@@ -67,13 +67,21 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
 static int config_string_cb(void *params_, const unsigned char *val, unsigned int _len) {
 #endif
     int len = (int)_len;
-    /* The id is ignored, we already have it in config.bar_id */
-    if (!strcmp(cur_key, "id"))
+    /* The id and socket_path are ignored, we already know them. */
+    if (!strcmp(cur_key, "id") || !strcmp(cur_key, "socket_path"))
         return 1;
 
     if (!strcmp(cur_key, "mode")) {
         DLOG("mode = %.*s, len = %d\n", len, val, len);
-        config.hide_on_modifier = (len == 4 && !strncmp((const char*)val, "hide", strlen("hide")));
+        config.hide_on_modifier = (len == 4 && !strncmp((const char*)val, "dock", strlen("dock")) ? M_DOCK
+            : (len == 4 && !strncmp((const char*)val, "hide", strlen("hide")) ? M_HIDE
+                : M_INVISIBLE));
+        return 1;
+    }
+
+    if (!strcmp(cur_key, "hidden_state")) {
+        DLOG("hidden_state = %.*s, len = %d\n", len, val, len);
+        config.hidden_state = (len == 4 && !strncmp((const char*)val, "hide", strlen("hide")) ? S_HIDE : S_SHOW);
         return 1;
     }
 
@@ -161,17 +169,18 @@ static int config_string_cb(void *params_, const unsigned char *val, unsigned in
 
     COLOR(statusline, bar_fg);
     COLOR(background, bar_bg);
+    COLOR(separator, sep_fg);
     COLOR(focused_workspace_border, focus_ws_border);
-    COLOR(focused_workspace_background, focus_ws_bg);
+    COLOR(focused_workspace_bg, focus_ws_bg);
     COLOR(focused_workspace_text, focus_ws_fg);
     COLOR(active_workspace_border, active_ws_border);
-    COLOR(active_workspace_background, active_ws_bg);
+    COLOR(active_workspace_bg, active_ws_bg);
     COLOR(active_workspace_text, active_ws_fg);
     COLOR(inactive_workspace_border, inactive_ws_border);
-    COLOR(inactive_workspace_background, inactive_ws_bg);
+    COLOR(inactive_workspace_bg, inactive_ws_bg);
     COLOR(inactive_workspace_text, inactive_ws_fg);
     COLOR(urgent_workspace_border, urgent_ws_border);
-    COLOR(urgent_workspace_background, urgent_ws_bg);
+    COLOR(urgent_workspace_bg, urgent_ws_bg);
     COLOR(urgent_workspace_text, urgent_ws_fg);
 
     printf("got unexpected string %.*s for cur_key = %s\n", len, val, cur_key);
@@ -184,6 +193,12 @@ static int config_string_cb(void *params_, const unsigned char *val, unsigned in
  *
  */
 static int config_boolean_cb(void *params_, int val) {
+    if (!strcmp(cur_key, "binding_mode_indicator")) {
+        DLOG("binding_mode_indicator = %d\n", val);
+        config.disable_binding_mode_indicator = !val;
+        return 1;
+    }
+
     if (!strcmp(cur_key, "workspace_buttons")) {
         DLOG("workspace_buttons = %d\n", val);
         config.disable_ws = !val;
@@ -260,6 +275,7 @@ void free_colors(struct xcb_color_strings_t *colors) {
     } while (0)
     FREE_COLOR(bar_fg);
     FREE_COLOR(bar_bg);
+    FREE_COLOR(sep_fg);
     FREE_COLOR(active_ws_fg);
     FREE_COLOR(active_ws_bg);
     FREE_COLOR(active_ws_border);