about summary refs log tree commit diff stats
diff options
context:
space:
mode:
author2015-08-19 21:11:15 +0200
committer2015-08-19 21:17:33 +0200
commit5d0c5be1028c67f3b499017c5c39019f4b1d8c10 (patch)
tree53b40f473b717e1903e5ab4bdf6fcc33fefdbedc
parent55dc32b27b73c121cab18009bf087e95ef3d9c18 (diff)
downloadtabbed-5d0c5be1028c67f3b499017c5c39019f4b1d8c10.tar.gz
-rw-r--r--config.def.h2
-rw-r--r--tabbed.13
-rw-r--r--tabbed.c12
3 files changed, 17 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h
index b3da7f0..55bec4c 100644
--- a/config.def.h
+++ b/config.def.h
@@ -55,6 +55,8 @@ static Key keys[] = { \
 
 	{ MODKEY,                       XK_q,      killclient,     { 0 } },
 
+	{ MODKEY,                       XK_u,      focusurgent,    { .v = NULL } },
+
 	{ 0,                            XK_F11,    fullscreen,     { 0 } },
 };
 
diff --git a/tabbed.1 b/tabbed.1
index 9e32115..05ac355 100644
--- a/tabbed.1
+++ b/tabbed.1
@@ -134,6 +134,9 @@ an already existing tab.
 .B Ctrl\-q
 close tab
 .TP
+.B Ctrl\-u
+focus next urgent tab
+.TP
 .B Ctrl\-[0..9]
 jumps to nth tab
 .TP
diff --git a/tabbed.c b/tabbed.c
index b15f9cb..93c9d0f 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -104,6 +104,7 @@ static void expose(const XEvent *e);
 static void focus(int c);
 static void focusin(const XEvent *e);
 static void focusonce(const Arg *arg);
+static void focusurgent(const Arg *);
 static void fullscreen(const Arg *arg);
 static char* getatom(int a);
 static int getclient(Window w);
@@ -492,6 +493,17 @@ focusonce(const Arg *arg) {
 }
 
 void
+focusurgent(const Arg *args) {
+	int c;
+	for(c = (sel+1)%nclients; c != sel; c = (c+1)%nclients) {
+		if(clients[c]->urgent) {
+			focus(c);
+			return;
+		}
+	}
+}
+
+void
 fullscreen(const Arg *arg) {
 	XEvent e;