Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

focus urgent window with a shortcut

  • Loading branch information...
commit 92664840e9f4bda4f4182382172d61c34e560f87 1 parent a67438a
Ivan Kanakarakis authored

Showing 2 changed files with 11 additions and 0 deletions. Show diff stats Hide diff stats

  1. 1  config.def.h
  2. 10  monsterwm.c
1  config.def.h
@@ -65,6 +65,7 @@ static const char *menucmd[] = { "dmenu_run", NULL };
65 65
 static Key keys[] = {
66 66
     /* modifier          key            function           argument */
67 67
     {  MOD1,             XK_b,          togglepanel,       {NULL}},
  68
+    {  MOD1,             XK_BackSpace,  focusurgent,       {NULL}},
68 69
     {  MOD1|SHIFT,       XK_c,          killclient,        {NULL}},
69 70
     {  MOD1,             XK_j,          next_win,          {NULL}},
70 71
     {  MOD1,             XK_k,          prev_win,          {NULL}},
10  monsterwm.c
@@ -83,6 +83,7 @@ static void change_desktop(const Arg *arg);
83 83
 static void change_monitor(const Arg *arg);
84 84
 static void client_to_desktop(const Arg *arg);
85 85
 static void client_to_monitor(const Arg *arg);
  86
+static void focusurgent();
86 87
 static void killclient();
87 88
 static void last_desktop();
88 89
 static void move_down();
@@ -646,6 +647,15 @@ void focusin(XEvent *e) {
646 647
 }
647 648
 
648 649
 /**
  650
+ * find and focus the first client which received
  651
+ * an urgent hint in the current desktop in the current monitor
  652
+ */
  653
+void focusurgent(void) {
  654
+    Desktop *d = &monitors[currmonidx].desktops[monitors[currmonidx].currdeskidx];
  655
+    for (Client *c = d->head; c; c = c->next) if (c->isurgn) focus(c, d, &monitors[currmonidx]);
  656
+}
  657
+
  658
+/**
649 659
  * get a pixel with the requested color to
650 660
  * fill some window area (such as borders)
651 661
  */

0 notes on commit 9266484

Please sign in to comment.
Something went wrong with that request. Please try again.