 +    XkbRF_VarDefsRec vd;
 +    char *tmp = NULL;
 +
-+    /* Getting all the stored Xkb options */
++    /* Getting all stored Xkb options */
 +    
 +    if (!XkbRF_GetNamesProp(dpy, &tmp, &vd) || !tmp)
 +    {

+        return -1;
+    }   
+
+    /* Maximal number of layouts are hardcoded to 2. 
+       I really don't have an idea how to handle this in case 
+       of 2+ groups because this method is based on checking of 
+       the Xkb Groups which there are 2 by default. 
+       I'll handle this behavior *later*, now it's just works. */
+
+    
+    char *layouts[MAX_LAYOUTS_COUNT]; 

+    }
+    if (counter == 1)
+    {
+        /* There is only one keyboard layout defined */
+        
+        strcpy(result, layouts[0]);
+        return 0;
