summaryrefslogtreecommitdiffhomepage
path: root/patch/focusurgent.c
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/focusurgent.c
parent1f21ed72d14af33fb490c14fcf809fe0606fadb0 (diff)
downloaddwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.tar.gz
dwm-flexipatch-9ebd9c8397c395d1ec8daf27723a70c901315bb3.zip
Adding focusurgent patch
Diffstat (limited to 'patch/focusurgent.c')
-rw-r--r--patch/focusurgent.c15
1 files changed, 15 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