diff --git a/awesomerc.1.txt b/awesomerc.1.txt index ce1dee45..1511420d 100644 --- a/awesomerc.1.txt +++ b/awesomerc.1.txt @@ -281,6 +281,7 @@ rules name= screen= tags= + not_master=<{true,false}> } } keys diff --git a/client.c b/client.c index 65151b99..0a5a901c 100644 --- a/client.c +++ b/client.c @@ -187,6 +187,22 @@ client_ban(Client * c) window_setstate(c->win, IconicState); } + +static void +client_attach_at_end(Client *c) +{ + Client *iter; + for(iter = globalconf.clients; iter && iter->next; iter = iter->next); + /* stack is empty */ + if(!iter) + globalconf.clients = c; + else + { + c->prev = iter; + iter->next = c; + } +} + /** Attach client to the beginning of the clients stack * \param c the client */ @@ -289,6 +305,7 @@ client_manage(Window w, XWindowAttributes *wa, int screen) XWindowChanges wc; Area area, darea; Tag *tag; + Rule *rule; c = p_new(Client, 1); @@ -381,7 +398,14 @@ client_manage(Window w, XWindowAttributes *wa, int screen) client_saveprops(c); /* attach to the stack */ - client_attach(c); + for(rule = globalconf.rules; rule; rule = rule->next) + if(rule->not_master && client_match_rule(c, rule)) + { + client_attach_at_end(c); + break; + } + if(!rule) + client_attach(c); /* some windows require this */ XMoveResizeWindow(globalconf.display, c->win, c->x, c->y, c->w, c->h); diff --git a/config.c b/config.c index 4b274828..2374bbc2 100644 --- a/config.c +++ b/config.c @@ -612,6 +612,7 @@ config_parse(const char *confpatharg) CFG_STR((char *) "icon", (char *) "", CFGF_NONE), CFG_BOOL((char *) "float", cfg_false, CFGF_NONE), CFG_INT((char *) "screen", RULE_NOSCREEN, CFGF_NONE), + CFG_BOOL((char *) "not_master", cfg_false, CFGF_NONE), CFG_END() }; static cfg_opt_t rules_opts[] = @@ -712,6 +713,7 @@ config_parse(const char *confpatharg) rule->icon = a_strdup(cfg_getstr(cfgsectmp, "icon")); rule->isfloating = cfg_getbool(cfgsectmp, "float"); rule->screen = cfg_getint(cfgsectmp, "screen"); + rule->not_master = cfg_getbool(cfgsectmp, "not_master"); if(rule->screen >= get_screen_count()) rule->screen = 0; diff --git a/config.h b/config.h index 20aee6af..d321f61f 100644 --- a/config.h +++ b/config.h @@ -45,6 +45,7 @@ struct Rule char *icon; int screen; Bool isfloating; + Bool not_master; regex_t *propregex; regex_t *tagregex; Rule *next;