mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
introduce 'groupsearch' for group menu search; matches on either group
number/shortcut and/or name.
This commit is contained in:
25
kbfunc.c
25
kbfunc.c
@ -187,6 +187,31 @@ kbfunc_menu_cmd(struct client_ctx *cc, union arg *arg)
|
||||
menuq_clear(&menuq);
|
||||
}
|
||||
|
||||
void
|
||||
kbfunc_menu_group(struct client_ctx *cc, union arg *arg)
|
||||
{
|
||||
struct screen_ctx *sc = cc->sc;
|
||||
struct group_ctx *gc;
|
||||
struct menu *mi;
|
||||
struct menu_q menuq;
|
||||
|
||||
TAILQ_INIT(&menuq);
|
||||
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
||||
if (group_holds_only_sticky(gc))
|
||||
continue;
|
||||
menuq_add(&menuq, gc, "%d %s", gc->num, gc->name);
|
||||
}
|
||||
|
||||
if ((mi = menu_filter(sc, &menuq, "group", NULL, CWM_MENU_LIST,
|
||||
search_match_text, search_print_group)) != NULL) {
|
||||
gc = (struct group_ctx *)mi->ctx;
|
||||
(group_holds_only_hidden(gc)) ?
|
||||
group_show(gc) : group_hide(gc);
|
||||
}
|
||||
|
||||
menuq_clear(&menuq);
|
||||
}
|
||||
|
||||
void
|
||||
kbfunc_client_cycle(struct client_ctx *cc, union arg *arg)
|
||||
{
|
||||
|
Reference in New Issue
Block a user