]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/config.c
Merge pull request #1657 from Georgiy-Tugai/fix-flickering-shortened
[i3/i3] / i3bar / src / config.c
index bb322619b427a3b33c1db31d22442ead6e145521..86f66cbb07fd6758235636458ac15a50a70540bb 100644 (file)
@@ -2,7 +2,7 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010 Axel Wagner and contributors (see also: LICENSE)
  *
  * config.c: Parses the configuration (received from i3).
  *
@@ -38,7 +38,7 @@ static int config_map_key_cb(void *params_, const unsigned char *keyVal, size_t
 }
 
 /*
- * Parse a null-value (current_workspace)
+ * Parse a null value (current_workspace)
  *
  */
 static int config_null_cb(void *params_) {
@@ -144,6 +144,13 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
         return 1;
     }
 
+    if (!strcmp(cur_key, "separator_symbol")) {
+        DLOG("separator = %.*s\n", len, val);
+        I3STRING_FREE(config.separator_symbol);
+        config.separator_symbol = i3string_from_utf8_with_length((const char *)val, len);
+        return 1;
+    }
+
     if (!strcmp(cur_key, "outputs")) {
         DLOG("+output %.*s\n", len, val);
         int new_num_outputs = config.num_outputs + 1;
@@ -231,7 +238,7 @@ static yajl_callbacks outputs_callbacks = {
 };
 
 /*
- * Start parsing the received bar configuration json-string
+ * Start parsing the received bar configuration JSON string
  *
  */
 void parse_config_json(char *json) {
@@ -241,13 +248,13 @@ void parse_config_json(char *json) {
 
     state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
 
-    /* FIXME: Proper errorhandling for JSON-parsing */
+    /* FIXME: Proper error handling for JSON parsing */
     switch (state) {
         case yajl_status_ok:
             break;
         case yajl_status_client_canceled:
         case yajl_status_error:
-            ELOG("Could not parse config-reply!\n");
+            ELOG("Could not parse config reply!\n");
             exit(EXIT_FAILURE);
             break;
     }