diff options
| author | bakkeby <[email protected]> | 2019-09-11 23:35:43 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2019-09-11 23:35:43 +0200 |
| commit | 706e06be438ec9e20e1ebcfcfbb0ff00bc2d2cc1 (patch) | |
| tree | 13958df791af844d7c02702c08fdf3dd9d4076d4 /patch | |
| parent | e89f262323c658478c92e4bea041e328c5126248 (diff) | |
| download | dwm-flexipatch-706e06be438ec9e20e1ebcfcfbb0ff00bc2d2cc1.tar.gz dwm-flexipatch-706e06be438ec9e20e1ebcfcfbb0ff00bc2d2cc1.zip | |
Adding combo patch
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/combo.c | 35 | ||||
| -rw-r--r-- | patch/combo.h | 3 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 |
4 files changed, 46 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 diff --git a/patch/combo.h b/patch/combo.h new file mode 100644 index 0000000..d6d141e --- /dev/null +++ b/patch/combo.h @@ -0,0 +1,3 @@ +static void keyrelease(XEvent *e); +static void combotag(const Arg *arg); +static void comboview(const Arg *arg);
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 43a636b..1ddc897 100644 --- a/patch/include.c +++ b/patch/include.c @@ -24,6 +24,10 @@ #include "cfacts.c" #endif +#if COMBO_PATCH +#include "combo.c" +#endif + #if CYCLELAYOUTS_PATCH #include "cyclelayouts.c" #endif diff --git a/patch/include.h b/patch/include.h index 49d3a1c..3e3027c 100644 --- a/patch/include.h +++ b/patch/include.h @@ -24,6 +24,10 @@ #include "cfacts.h" #endif +#if COMBO_PATCH +#include "combo.h" +#endif + #if CYCLELAYOUTS_PATCH #include "cyclelayouts.h" #endif |
