continue;
}
+ if (strcasecmp(key, "floating_modifier") == 0) {
+ char *walk = value;
+ uint32_t modifiers = 0;
+
+ while (*walk != '\0') {
+ /* Need to check for Mod1-5, Ctrl, Shift, Mode_switch */
+ CHECK_MODIFIER(SHIFT);
+ CHECK_MODIFIER(CONTROL);
+ CHECK_MODIFIER(MODE_SWITCH);
+ CHECK_MODIFIER(MOD1);
+ CHECK_MODIFIER(MOD2);
+ CHECK_MODIFIER(MOD3);
+ CHECK_MODIFIER(MOD4);
+ CHECK_MODIFIER(MOD5);
+
+ /* No modifier found? Then we’re done with this step */
+ break;
+ }
+
+ LOG("Floating modifiers = %d\n", modifiers);
+ config.floating_modifier = modifiers;
+ continue;
+ }
+
/* assign window class[/window title] → workspace */
if (strcasecmp(key, "assign") == 0) {
LOG("assign: \"%s\"\n", value);
*end = '\0';
}
+ /* Strip trailing whitespace */
+ while (strlen(value) > 0 && value[strlen(value)-1] == ' ')
+ value[strlen(value)-1] = '\0';
+
/* The target is the last argument separated by a space */
if ((target = strrchr(value, ' ')) == NULL)
die("Malformed assignment, couldn't find target\n");
target++;
- if (atoi(target) < 1 || atoi(target) > 10)
+ if (*target != '~' && (atoi(target) < 1 || atoi(target) > 10))
die("Malformed assignment, invalid workspace number\n");
LOG("assignment parsed: \"%s\" to \"%s\"\n", class_title, target);
- struct Assignment *new = smalloc(sizeof(struct Assignment));
+ struct Assignment *new = scalloc(sizeof(struct Assignment));
new->windowclass_title = class_title;
- new->workspace = atoi(target);
+ if (*target == '~')
+ new->floating = true;
+ else new->workspace = atoi(target);
TAILQ_INSERT_TAIL(&assignments, new, assignments);
continue;
}