diff options
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/focusurgent.c | 15 | ||||
| -rw-r--r-- | patch/focusurgent.h | 1 | ||||
| -rw-r--r-- | patch/include.c | 4 | ||||
| -rw-r--r-- | patch/include.h | 4 |
4 files changed, 24 insertions, 0 deletions
diff --git a/patch/focusurgent.c b/patch/focusurgent.c new file mode 100644 index 0000000..67d71bc --- /dev/null +++ b/patch/focusurgent.c @@ -0,0 +1,15 @@ +void +focusurgent(const Arg *arg) +{ + Client *c; + int i; + for (c=selmon->clients; c && !c->isurgent; c=c->next); + if (c) { + for (i=0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); + if (i < LENGTH(tags)) { + const Arg a = {.ui = 1 << i}; + view(&a); + focus(c); + } + } +}
\ No newline at end of file diff --git a/patch/focusurgent.h b/patch/focusurgent.h new file mode 100644 index 0000000..27ab8ac --- /dev/null +++ b/patch/focusurgent.h @@ -0,0 +1 @@ +static void focusurgent(const Arg *arg);
\ No newline at end of file diff --git a/patch/include.c b/patch/include.c index 82b151b..cd52548 100644 --- a/patch/include.c +++ b/patch/include.c @@ -40,6 +40,10 @@ #include "focusadjacenttag.c" #endif +#if FOCUSURGENT_PATCH +#include "focusurgent.c" +#endif + #if FULLSCREEN_PATCH #include "fullscreen.c" #endif diff --git a/patch/include.h b/patch/include.h index 74b5404..ca2940a 100644 --- a/patch/include.h +++ b/patch/include.h @@ -40,6 +40,10 @@ #include "focusadjacenttag.h" #endif +#if FOCUSURGENT_PATCH +#include "focusurgent.h" +#endif + #if FULLSCREEN_PATCH #include "fullscreen.h" #endif |
