Add theme option in [client]
This commit is contained in:
parent
2bf2011cf1
commit
69391afed8
24
src/config.c
24
src/config.c
@ -12,6 +12,12 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
|
|
||||||
|
#define ISTRDUP(t, s) \
|
||||||
|
do { \
|
||||||
|
if((tmp = s)) \
|
||||||
|
t = xstrdup(tmp); \
|
||||||
|
} while(/* CONSTCOND */ 0);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
config_mouse_section(struct mbhead *mousebinds, struct conf_sec **sec)
|
config_mouse_section(struct mbhead *mousebinds, struct conf_sec **sec)
|
||||||
{
|
{
|
||||||
@ -202,11 +208,14 @@ static void
|
|||||||
config_client(void)
|
config_client(void)
|
||||||
{
|
{
|
||||||
struct conf_sec *sec, **mb;
|
struct conf_sec *sec, **mb;
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
/* [client] */
|
/* [client] */
|
||||||
sec = fetch_section_first(NULL, "client");
|
sec = fetch_section_first(NULL, "client");
|
||||||
|
|
||||||
W->client_mod = modkey_keysym(fetch_opt_first(sec, "Super", "key_modifier").str);
|
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] */
|
/* [mouse] */
|
||||||
/* for client frame AND titlebar */
|
/* for client frame AND titlebar */
|
||||||
@ -217,18 +226,12 @@ config_client(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ISTRDUP(t, s) \
|
|
||||||
do { \
|
|
||||||
if((tmp = s)) \
|
|
||||||
t = xstrdup(tmp); \
|
|
||||||
} while(/* CONSTCOND */ 0);
|
|
||||||
static void
|
static void
|
||||||
config_rule(void)
|
config_rule(void)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
struct conf_sec *sec, **ks;
|
struct conf_sec *sec, **ks;
|
||||||
struct rule *r;
|
struct rule *r;
|
||||||
struct theme *t;
|
|
||||||
char *tn, *tmp;
|
char *tn, *tmp;
|
||||||
|
|
||||||
/* [rules] */
|
/* [rules] */
|
||||||
@ -256,14 +259,7 @@ config_rule(void)
|
|||||||
FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "ignore_tag").boolean, RULE_IGNORE_TAG);
|
FLAGAPPLY(r->flags, fetch_opt_first(ks[i], "false", "ignore_tag").boolean, RULE_IGNORE_TAG);
|
||||||
|
|
||||||
if((tn = fetch_opt_first(ks[i], "", "theme").str))
|
if((tn = fetch_opt_first(ks[i], "", "theme").str))
|
||||||
{
|
r->theme = name_to_theme(tn);
|
||||||
SLIST_FOREACH(t, &W->h.theme, next)
|
|
||||||
if(!strcmp(tn, t->name))
|
|
||||||
{
|
|
||||||
r->theme = t;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
r->theme = SLIST_FIRST(&W->h.theme);
|
r->theme = SLIST_FIRST(&W->h.theme);
|
||||||
|
|
||||||
|
|||||||
@ -322,6 +322,7 @@ struct wmfs
|
|||||||
char **argv;
|
char **argv;
|
||||||
char *confpath;
|
char *confpath;
|
||||||
struct barwin *last_clicked_barwin;
|
struct barwin *last_clicked_barwin;
|
||||||
|
struct theme *ctheme;
|
||||||
|
|
||||||
/* FIFO stuffs */
|
/* FIFO stuffs */
|
||||||
struct
|
struct
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user