Adding combo patch
This commit is contained in:
35
patch/combo.c
Normal file
35
patch/combo.c
Normal file
@ -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);
|
||||
}
|
3
patch/combo.h
Normal file
3
patch/combo.h
Normal file
@ -0,0 +1,3 @@
|
||||
static void keyrelease(XEvent *e);
|
||||
static void combotag(const Arg *arg);
|
||||
static void comboview(const Arg *arg);
|
@ -24,6 +24,10 @@
|
||||
#include "cfacts.c"
|
||||
#endif
|
||||
|
||||
#if COMBO_PATCH
|
||||
#include "combo.c"
|
||||
#endif
|
||||
|
||||
#if CYCLELAYOUTS_PATCH
|
||||
#include "cyclelayouts.c"
|
||||
#endif
|
||||
|
@ -24,6 +24,10 @@
|
||||
#include "cfacts.h"
|
||||
#endif
|
||||
|
||||
#if COMBO_PATCH
|
||||
#include "combo.h"
|
||||
#endif
|
||||
|
||||
#if CYCLELAYOUTS_PATCH
|
||||
#include "cyclelayouts.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user