Greetings comrades,
attached is a patch to add a Mod + u, which will switch
to the next urgent window in the window list. This idea
was proudly stolen from awesome.
Sincerely,
Christoph Lohmann
diff -r cb2ba6763beb config.def.h
--- a/config.def.h Sun Oct 09 20:53:51 2011 +0200
+++ b/config.def.h Mon Dec 12 16:26:30 2011 +0100
@@ -60,6 +60,7 @@
{ MODKEY, XK_Return, zoom, {0} },
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
+ { MODKEY, XK_u, showurgent, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
diff -r cb2ba6763beb dwm.c
--- a/dwm.c Sun Oct 09 20:53:51 2011 +0200
+++ b/dwm.c Mon Dec 12 16:26:30 2011 +0100
@@ -219,6 +219,7 @@
static void setmfact(const Arg *arg);
static void setup(void);
static void showhide(Client *c);
+static void showurgent(const Arg *arg);
static void sigchld(int unused);
static void spawn(const Arg *arg);
static void tag(const Arg *arg);
@@ -1620,6 +1621,30 @@
}
void
+showurgent(const Arg *arg) {
+ Monitor *m;
+ Client *c;
+ Arg a;
+
+ for(m = mons; m; m = m->next) {
+ for(c = m->clients; c; c = c->next) {
+ if(c->isurgent) {
+ if(m != selmon) {
+ unfocus(selmon->sel, True);
+ selmon = c->mon;
+ focus(NULL);
+ }
+ a.ui = c->tags;
+ view(&a);
+ focus(c);
+ arrange(selmon);
+ return;
+ }
+ }
+ }
+}
+
+void
sigchld(int unused) {
if(signal(SIGCHLD, sigchld) == SIG_ERR)
die("Can't install SIGCHLD handler");