Implement putting clients into floating mode at a specific workspace
This changes syntax of the assign command a bit. Old configurations will continue to work. See the userguide.
This commit is contained in:
24
src/config.c
24
src/config.c
@ -269,17 +269,33 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath)
|
||||
die("Malformed assignment, couldn't find target\n");
|
||||
target++;
|
||||
|
||||
if (*target != '~' && (atoi(target) < 1 || atoi(target) > 10))
|
||||
if (strchr(target, '~') == NULL && (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 = scalloc(sizeof(struct Assignment));
|
||||
new->windowclass_title = class_title;
|
||||
if (*target == '~')
|
||||
new->floating = true;
|
||||
else new->workspace = atoi(target);
|
||||
if (strchr(target, '~') != NULL)
|
||||
new->floating = ASSIGN_FLOATING_ONLY;
|
||||
|
||||
while (*target == '~')
|
||||
target++;
|
||||
|
||||
if (atoi(target) >= 1 && atoi(target) <= 10) {
|
||||
if (new->floating == ASSIGN_FLOATING_ONLY)
|
||||
new->floating = ASSIGN_FLOATING;
|
||||
new->workspace = atoi(target);
|
||||
}
|
||||
TAILQ_INSERT_TAIL(&assignments, new, assignments);
|
||||
|
||||
LOG("Assignment loaded: \"%s\":\n", class_title);
|
||||
if (new->floating != ASSIGN_FLOATING_ONLY)
|
||||
LOG(" to workspace %d\n", new->workspace);
|
||||
|
||||
if (new->floating != ASSIGN_FLOATING_NO)
|
||||
LOG(" will be floating\n");
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user