mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Add group-last command that shows only the previously active group; ok okan
This commit is contained in:
parent
81a08ddb89
commit
7c22b36a23
2
calmwm.h
2
calmwm.h
@ -214,6 +214,7 @@ struct screen_ctx {
|
||||
struct region_q regionq;
|
||||
struct group_q groupq;
|
||||
struct group_ctx *group_active;
|
||||
struct group_ctx *group_last;
|
||||
Colormap colormap;
|
||||
Visual *visual;
|
||||
struct {
|
||||
@ -501,6 +502,7 @@ void kbfunc_client_toggle_group(void *, struct cargs *);
|
||||
void kbfunc_client_movetogroup(void *, struct cargs *);
|
||||
void kbfunc_group_toggle(void *, struct cargs *);
|
||||
void kbfunc_group_only(void *, struct cargs *);
|
||||
void kbfunc_group_last(void *, struct cargs *);
|
||||
void kbfunc_group_close(void *, struct cargs *);
|
||||
void kbfunc_group_cycle(void *, struct cargs *);
|
||||
void kbfunc_group_toggle_all(void *, struct cargs *);
|
||||
|
1
conf.c
1
conf.c
@ -139,6 +139,7 @@ static const struct {
|
||||
|
||||
{ FUNC_SC(group-cycle, group_cycle, (CWM_CYCLE_FORWARD)) },
|
||||
{ FUNC_SC(group-rcycle, group_cycle, (CWM_CYCLE_REVERSE)) },
|
||||
{ FUNC_SC(group-last, group_last, 0) },
|
||||
{ FUNC_SC(group-toggle-all, group_toggle_all, 0) },
|
||||
{ FUNC_SC(group-toggle-1, group_toggle, 1) },
|
||||
{ FUNC_SC(group-toggle-2, group_toggle, 2) },
|
||||
|
2
cwmrc.5
2
cwmrc.5
@ -273,6 +273,8 @@ menu.
|
||||
Toggle visibility of group n, where n is 1-9.
|
||||
.It group-only-[n]
|
||||
Show only group n, where n is 1-9, hiding other groups.
|
||||
.It group-last
|
||||
Show only the previously active group.
|
||||
.It group-close-[n]
|
||||
Close all windows in group n, where n is 1-9.
|
||||
.It group-toggle-all
|
||||
|
3
group.c
3
group.c
@ -215,6 +215,9 @@ group_only(struct screen_ctx *sc, int idx)
|
||||
{
|
||||
struct group_ctx *gc;
|
||||
|
||||
if (sc->group_last != sc->group_active)
|
||||
sc->group_last = sc->group_active;
|
||||
|
||||
TAILQ_FOREACH(gc, &sc->groupq, entry) {
|
||||
if (gc->num == idx)
|
||||
group_show(gc);
|
||||
|
8
kbfunc.c
8
kbfunc.c
@ -478,6 +478,14 @@ kbfunc_group_only(void *ctx, struct cargs *cargs)
|
||||
group_only(ctx, cargs->flag);
|
||||
}
|
||||
|
||||
void
|
||||
kbfunc_group_last(void *ctx, struct cargs *cargs)
|
||||
{
|
||||
struct screen_ctx *sc = ctx;
|
||||
|
||||
group_only(ctx, sc->group_last->num);
|
||||
}
|
||||
|
||||
void
|
||||
kbfunc_group_toggle(void *ctx, struct cargs *cargs)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user