diff options
Diffstat (limited to 'patch/combo.c')
| -rw-r--r-- | patch/combo.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/patch/combo.c b/patch/combo.c new file mode 100644 index 0000000..d34142a --- /dev/null +++ b/patch/combo.c @@ -0,0 +1,35 @@ +static int combo = 0; + +void +keyrelease(XEvent *e) { + combo = 0; +} + +void +combotag(const Arg *arg) { + if(selmon->sel && arg->ui & TAGMASK) { + if (combo) { + selmon->sel->tags |= arg->ui & TAGMASK; + } else { + combo = 1; + selmon->sel->tags = arg->ui & TAGMASK; + } + focus(NULL); + arrange(selmon); + } +} + +void +comboview(const Arg *arg) { + unsigned newtags = arg->ui & TAGMASK; + if (combo) { + selmon->tagset[selmon->seltags] |= newtags; + } else { + selmon->seltags ^= 1; /*toggle tagset*/ + combo = 1; + if (newtags) + selmon->tagset[selmon->seltags] = newtags; + } + focus(NULL); + arrange(selmon); +}
\ No newline at end of file |
