mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
add conf_ignore and move group_make_autogroup to conf_autogroup to match.
This commit is contained in:
parent
16ed8bf8e4
commit
a899d267fe
3
calmwm.h
3
calmwm.h
@ -352,7 +352,6 @@ void group_client_delete(struct client_ctx *);
|
||||
void group_cycle(struct screen_ctx *, int);
|
||||
void group_hidetoggle(struct screen_ctx *, int);
|
||||
void group_init(struct screen_ctx *);
|
||||
void group_make_autogroup(struct conf *, char *, int);
|
||||
void group_menu(XButtonEvent *);
|
||||
void group_movetogroup(struct client_ctx *, int);
|
||||
void group_only(struct screen_ctx *, int);
|
||||
@ -436,6 +435,7 @@ void menuq_clear(struct menu_q *);
|
||||
|
||||
int parse_config(const char *, struct conf *);
|
||||
|
||||
void conf_autogroup(struct conf *, int, char *);
|
||||
void conf_bindname(struct conf *, char *, char *);
|
||||
void conf_clear(struct conf *);
|
||||
void conf_client(struct client_ctx *);
|
||||
@ -446,6 +446,7 @@ void conf_gap(struct conf *, struct screen_ctx *);
|
||||
void conf_grab(struct conf *, struct keybinding *);
|
||||
void conf_grab_mouse(struct client_ctx *);
|
||||
void conf_init(struct conf *);
|
||||
void conf_ignore(struct conf *, char *);
|
||||
void conf_mousebind(struct conf *, char *, char *);
|
||||
void conf_ungrab(struct conf *, struct keybinding *);
|
||||
|
||||
|
33
conf.c
33
conf.c
@ -52,6 +52,39 @@ conf_cmd_add(struct conf *c, char *image, char *label)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
conf_autogroup(struct conf *c, int no, char *val)
|
||||
{
|
||||
struct autogroupwin *aw;
|
||||
char *p;
|
||||
|
||||
aw = xcalloc(1, sizeof(*aw));
|
||||
|
||||
if ((p = strchr(val, ',')) == NULL) {
|
||||
aw->name = NULL;
|
||||
aw->class = xstrdup(val);
|
||||
} else {
|
||||
*(p++) = '\0';
|
||||
aw->name = xstrdup(val);
|
||||
aw->class = xstrdup(p);
|
||||
}
|
||||
aw->num = no;
|
||||
|
||||
TAILQ_INSERT_TAIL(&c->autogroupq, aw, entry);
|
||||
}
|
||||
|
||||
void
|
||||
conf_ignore(struct conf *c, char *val)
|
||||
{
|
||||
struct winmatch *wm;
|
||||
|
||||
wm = xcalloc(1, sizeof(*wm));
|
||||
|
||||
(void)strlcpy(wm->title, val, sizeof(wm->title));
|
||||
|
||||
TAILQ_INSERT_TAIL(&c->ignoreq, wm, entry);
|
||||
}
|
||||
|
||||
void
|
||||
conf_gap(struct conf *c, struct screen_ctx *sc)
|
||||
{
|
||||
|
21
group.c
21
group.c
@ -163,27 +163,6 @@ group_init(struct screen_ctx *sc)
|
||||
group_setactive(sc, 1);
|
||||
}
|
||||
|
||||
void
|
||||
group_make_autogroup(struct conf *conf, char *val, int no)
|
||||
{
|
||||
struct autogroupwin *aw;
|
||||
char *p;
|
||||
|
||||
aw = xcalloc(1, sizeof(*aw));
|
||||
|
||||
if ((p = strchr(val, ',')) == NULL) {
|
||||
aw->name = NULL;
|
||||
aw->class = xstrdup(val);
|
||||
} else {
|
||||
*(p++) = '\0';
|
||||
aw->name = xstrdup(val);
|
||||
aw->class = xstrdup(p);
|
||||
}
|
||||
aw->num = no;
|
||||
|
||||
TAILQ_INSERT_TAIL(&conf->autogroupq, aw, entry);
|
||||
}
|
||||
|
||||
static void
|
||||
group_setactive(struct screen_ctx *sc, long idx)
|
||||
{
|
||||
|
9
parse.y
9
parse.y
@ -137,16 +137,11 @@ main : FONTNAME STRING {
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
group_make_autogroup(conf, $3, $2);
|
||||
conf_autogroup(conf, $2, $3);
|
||||
free($3);
|
||||
}
|
||||
| IGNORE STRING {
|
||||
struct winmatch *wm;
|
||||
|
||||
wm = xcalloc(1, sizeof(*wm));
|
||||
(void)strlcpy(wm->title, $2, sizeof(wm->title));
|
||||
TAILQ_INSERT_TAIL(&conf->ignoreq, wm, entry);
|
||||
|
||||
conf_ignore(conf, $2);
|
||||
free($2);
|
||||
}
|
||||
| BIND STRING string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user