about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--dwm.h2
-rw-r--r--event.c2
-rw-r--r--tag.c14
3 files changed, 18 insertions, 0 deletions
diff --git a/dwm.h b/dwm.h
index bcdb4e3..0b6b21f 100644
--- a/dwm.h
+++ b/dwm.h
@@ -143,6 +143,8 @@ extern void replacetag(Arg *arg);
 extern void settags(Client *c);
 extern void togglemode(Arg *arg);
 extern void view(Arg *arg);
+extern void viewnext(Arg *arg);
+extern void viewprev(Arg *arg);
 
 /* util.c */
 extern void *emallocz(unsigned int size);
diff --git a/event.c b/event.c
index 17be71d..2cebc9e 100644
--- a/event.c
+++ b/event.c
@@ -32,8 +32,10 @@ static Key key[] = {
 	{ MODKEY,		XK_2,		view,		{ .i = Tnet } }, 
 	{ MODKEY,		XK_3,		view,		{ .i = Twork } }, 
 	{ MODKEY,		XK_4,		view,		{ .i = Tmisc} }, 
+	{ MODKEY,		XK_h,		viewprev,	{ 0 } },
 	{ MODKEY,		XK_j,		focusnext,	{ 0 } }, 
 	{ MODKEY,		XK_k,		focusprev,	{ 0 } },
+	{ MODKEY,		XK_l,		viewnext,	{ 0 } },
 	{ MODKEY,		XK_m,		togglemax,	{ 0 } }, 
 	{ MODKEY,		XK_space,	togglemode,	{ 0 } }, 
 	{ MODKEY,		XK_Return,	zoom,		{ 0 } },
diff --git a/tag.c b/tag.c
index c42a760..6b7e184 100644
--- a/tag.c
+++ b/tag.c
@@ -216,3 +216,17 @@ view(Arg *arg)
 	arrange(NULL);
 	drawall();
 }
+
+void
+viewnext(Arg *arg)
+{
+	arg->i = (tsel < TLast-1) ? tsel+1 : 0;
+	view(arg);
+}
+
+void
+viewprev(Arg *arg)
+{
+	arg->i = (tsel > 0) ? tsel-1 : TLast-1;
+	view(arg);
+}
n161' href='#n161'>161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219