summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-10-03 00:10:08 +0200
committerbakkeby <[email protected]>2019-10-03 00:10:08 +0200
commit9ebd9c8397c395d1ec8daf27723a70c901315bb3 (patch)
tree9d1f4d861d0f319243f33fe892d4b3407666ecf3 /patch
parent1f21ed72d14af33fb490c14fcf809fe0606fadb0 (diff)
downloaddwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.tar.gz
dwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.zip
Adding focusurgent patch
Diffstat (limited to 'patch')
-rw-r--r--patch/focusurgent.c15
-rw-r--r--patch/focusurgent.h1
-rw-r--r--patch/include.c4
-rw-r--r--patch/include.h4
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