diff --git a/src/client.c b/src/client.c index 559bbaa..40ee9ec 100644 --- a/src/client.c +++ b/src/client.c @@ -1133,6 +1133,9 @@ client_set_rules(Client *c) if(!conf.rule[i].ignoretags) tags[c->screen][c->tag].layout.func(c->screen); + + if(conf.rule[i].follow_client) + seltag[c->screen] = c->tag; } } } diff --git a/src/config.c b/src/config.c index ce87837..87358b8 100644 --- a/src/config.c +++ b/src/config.c @@ -637,14 +637,15 @@ conf_rule_section(void) for(i = 0; i < conf.nrule; ++i) { - conf.rule[i].class = fetch_opt_first(rule[i], "", "class").str; - conf.rule[i].instance = fetch_opt_first(rule[i], "", "instance").str; - conf.rule[i].role = fetch_opt_first(rule[i], "", "role").str; - conf.rule[i].screen = fetch_opt_first(rule[i], "-1", "screen").num; - conf.rule[i].tag = fetch_opt_first(rule[i], "-1", "tag").num; - conf.rule[i].free = fetch_opt_first(rule[i], "false", "free").bool; - conf.rule[i].max = fetch_opt_first(rule[i], "false", "max").bool; - conf.rule[i].ignoretags = fetch_opt_first(rule[i], "false", "ignoretags").bool; + conf.rule[i].class = fetch_opt_first(rule[i], "", "class").str; + conf.rule[i].instance = fetch_opt_first(rule[i], "", "instance").str; + conf.rule[i].role = fetch_opt_first(rule[i], "", "role").str; + conf.rule[i].screen = fetch_opt_first(rule[i], "-1", "screen").num; + conf.rule[i].tag = fetch_opt_first(rule[i], "-1", "tag").num; + conf.rule[i].free = fetch_opt_first(rule[i], "false", "free").bool; + conf.rule[i].max = fetch_opt_first(rule[i], "false", "max").bool; + conf.rule[i].ignoretags = fetch_opt_first(rule[i], "false", "ignoretags").bool; + conf.rule[i].follow_client = fetch_opt_first(rule[i], "false", "follow_client").bool; } free(rule); diff --git a/src/structs.h b/src/structs.h index 0cfebc1..a93d98a 100644 --- a/src/structs.h +++ b/src/structs.h @@ -366,6 +366,7 @@ typedef struct Bool free; Bool max; Bool ignoretags; + Bool follow_client; } Rule; /* Configuration structure */ diff --git a/wmfsrc b/wmfsrc index 581e494..18317ef 100644 --- a/wmfsrc +++ b/wmfsrc @@ -213,13 +213,14 @@ [rules] # Example of rule for MPlayer [rule] - instance = "xv" # First part of WM_CLASS - class = "MPlayer" # Seconf part of WM_CLASS, not needed if first part is correct - # role = "" # WM_WINDOW_ROLE - screen = 0 # Screen to use - tag = 2 # Tag number of apps - free = true # Set automatic free client - max = false # Set automatic maximized client + instance = "xv" # First part of WM_CLASS + class = "MPlayer" # Seconf part of WM_CLASS, not needed if first part is correct + # role = "" # WM_WINDOW_ROLE + screen = 0 # Screen to use + tag = 2 # Tag number of apps + free = true # Set automatic free client + max = false # Set automatic maximized client + follow_client = false # follow the client [/rule] [/rules]