gm

(orphaned) group manager using libcxb
git clone git://z3bra.org/gm
Log | Files | Refs | README | LICENSE

commit ce5bd4621f4b8e8278111a6e2993371a74c8009f
parent 85b3a79a2ddf360bc042035eb751d553de29cf95
Author: z3bra <willy@mailoo.org>
Date:   Mon Nov 17 00:12:48 2014

Removed debug and added a way to show only one group

Diffstat:
 config.h |  6 ++++++
 gm.c     | 27 +++++++++------------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/config.h b/config.h @@ -12,6 +12,12 @@ static struct hotkey keys[] = { { MOD, XK_F4, togglegroup, 4}, { MOD, XK_F5, togglegroup, 5}, + { ALT, XK_F1, solelygroup, 1}, + { ALT, XK_F2, solelygroup, 2}, + { ALT, XK_F3, solelygroup, 3}, + { ALT, XK_F4, solelygroup, 4}, + { ALT, XK_F5, solelygroup, 5}, + { MOD|SHIFT, XK_F1, changegroup, 1}, { MOD|SHIFT, XK_F2, changegroup, 2}, { MOD|SHIFT, XK_F3, changegroup, 3}, diff --git a/gm.c b/gm.c @@ -68,6 +68,7 @@ void mapgrp (uint8_t); void hidgrp (uint8_t); void delgroup (struct window *); void addgroup (struct window *, uint8_t); +void solelygroup (struct window *, uint8_t); void changegroup (struct window *, uint8_t); void togglegroup (struct window *, uint8_t); @@ -197,22 +198,18 @@ uint8_t ismapped(xcb_window_t w) return ms; } -#ifdef DEBUG -void lsgrp() +/* hide all groups except the one specified */ +void solelygroup(struct window *np, uint8_t g) { - uint8_t g; - struct window *np; + int i; - logx("\ngroup summary:" - "\n--------------\n"); - for (g = 0; g < GROUPNUM; g++) { - for (np = groups[g]; np; np = np->next) { - logx("\t%d:0x%08x\n", g, np->id); - } + for (i=1; i<GROUPNUM; i++) { + i == g ? mapgrp(i) : hidgrp(i); } - return; /* void */ + + xcb_flush(con); + return; } -#endif void changegroup(struct window *np, uint8_t g) { @@ -308,12 +305,6 @@ void mapgrp(uint8_t g) logx("map: %d - %08x\n", g, np->id); } - -#ifdef DEBUG - lsgrp(); -#endif - - return; }