static void config_client(void) { struct conf_sec *sec, **mb; char *tmp; /* [client] */ sec = fetch_section_first(NULL, "client"); W->padding = fetch_opt_first(sec, "0", "padding").num; W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str); if(fetch_opt_first(sec, "0", "autofocus").boolean) W->flags |= WMFS_AUTOFOCUS; /* Get theme */ tmp = fetch_opt_first(sec, "default", "theme").str; W->ctheme = name_to_theme(tmp); /* Get focus configuration */ W->cfocus = 0; tmp = fetch_opt_first(sec, "enter", "focus").str; if(strstr(tmp, "enter")) W->cfocus |= CFOCUS_ENTER; if(strstr(tmp, "click")) W->cfocus |= CFOCUS_CLICK; /* [mouse] */ /* for client frame AND titlebar */ if((mb = fetch_section(sec, "mouse"))) { config_mouse_section(&W->tmp_head.client, mb); free(mb); } }
static void config_bars(void) { struct screen *s; struct theme *t; size_t i, n; struct conf_sec *sec, **ks; int screenid; char *name, *elem; enum barpos pos = BarTop; /* [bars] */ sec = fetch_section_first(NULL, "bars"); ks = fetch_section(sec, "bar"); n = fetch_section_count(ks); /* [bar] */ for(i = 0; i < n; ++i) { name = fetch_opt_first(ks[i], "default", "name").str; elem = fetch_opt_first(ks[i], "", "elements").str; screenid = fetch_opt_first(ks[i], "-1", "screen").num; t = name_to_theme(fetch_opt_first(ks[i], "default", "theme").str); pos = fetch_opt_first(ks[i], "0", "position").num; SLIST_FOREACH(s, &W->h.screen, next) if(screenid == s->id || screenid == -1) infobar_new(s, name, t, pos, elem); } free(ks); }
static void config_rule(void) { int i, n; struct conf_sec *sec, **ks; struct rule *r; char *tn, *tmp; /* [rules] */ sec = fetch_section_first(NULL, "rules"); ks = fetch_section(sec, "rule"); n = fetch_section_count(ks); SLIST_INIT(&W->h.rule); /* [rule] */ for(i = 0; i < n; ++i) { r = (struct rule*)xcalloc(1, sizeof(struct rule)); ISTRDUP(r->class, fetch_opt_first(ks[i], "", "class").str); ISTRDUP(r->instance, fetch_opt_first(ks[i], "", "instance").str); ISTRDUP(r->role, fetch_opt_first(ks[i], "", "role").str); ISTRDUP(r->name , fetch_opt_first(ks[i], "", "name").str); ISTRDUP(r->client_machine, fetch_opt_first(ks[i], "", "client_machine").str); r->screen = fetch_opt_first(ks[i], "-1", "screen").num; r->tag = fetch_opt_first(ks[i], "-1", "tag").num; FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "free").boolean, RULE_FREE); FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "tab").boolean, RULE_TAB); FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "ignore_tag").boolean, RULE_IGNORE_TAG); if((tn = fetch_opt_first(ks[i], "", "theme").str)) r->theme = name_to_theme(tn); else r->theme = W->ctheme; SLIST_INSERT_HEAD(&W->h.rule, r, next); } free(ks); }
static void config_client(void) { struct conf_sec *sec, **mb; char *tmp; /* [client] */ sec = fetch_section_first(NULL, "client"); W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str); tmp = fetch_opt_first(sec, "default", "theme").str; W->ctheme = name_to_theme(tmp); /* [mouse] */ /* for client frame AND titlebar */ if((mb = fetch_section(sec, "mouse"))) { config_mouse_section(&W->tmp_head.client, mb); free(mb); } }