]> git.sur5r.net Git - i3/i3/blobdiff - i3bar/src/config.c
ipc: rename COMMAND to RUN_COMMAND for consistency (#2956)
[i3/i3] / i3bar / src / config.c
index bc13f3d902f321f183a0c51ae66017a8869778cd..cbe84d5073e55b714a2d564fd4d666fdfb872e1a 100644 (file)
@@ -7,6 +7,8 @@
  * config.c: Parses the configuration (received from i3).
  *
  */
+#include "common.h"
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -17,8 +19,6 @@
 
 #include <X11/Xlib.h>
 
-#include "common.h"
-
 static char *cur_key;
 static bool parsing_bindings;
 static bool parsing_tray_outputs;
@@ -121,6 +121,11 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
 
     if (!strcmp(cur_key, "modifier")) {
         DLOG("modifier = %.*s\n", len, val);
+        if (len == 4 && !strncmp((const char *)val, "none", strlen("none"))) {
+            config.modifier = XCB_NONE;
+            return 1;
+        }
+
         if (len == 5 && !strncmp((const char *)val, "shift", strlen("shift"))) {
             config.modifier = ShiftMask;
             return 1;
@@ -140,16 +145,12 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
                 case '3':
                     config.modifier = Mod3Mask;
                     return 1;
-                /*
-                case '4':
-                    config.modifier = Mod4Mask;
-                    return 1;
-                */
                 case '5':
                     config.modifier = Mod5Mask;
                     return 1;
             }
         }
+
         config.modifier = Mod4Mask;
         return 1;
     }
@@ -184,6 +185,7 @@ static int config_string_cb(void *params_, const unsigned char *val, size_t _len
 
     if (!strcmp(cur_key, "status_command")) {
         DLOG("command = %.*s\n", len, val);
+        FREE(config.command);
         sasprintf(&config.command, "%.*s", len, val);
         return 1;
     }