JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
new colors
[dwm.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 9ac4e72..c14c3e6 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -5,22 +5,38 @@
 
 #include "wm.h"
 #include <stdio.h>
+#include <string.h>
 
 void
-run(char *arg)
+run(void *aux)
 {
-       spawn(dpy, arg);
+       spawn(dpy, aux);
 }
 
 void
-quit(char *arg)
+quit(void *aux)
 {
-       fputs("quit\n", stderr);
        running = False;
 }
 
 void
-kill(char *arg)
+sel(void *aux)
+{
+       const char *arg = aux;
+       Client *c;
+
+       if(!arg || !stack)
+               return;
+       if(!strncmp(arg, "next", 5))
+               focus(stack->snext ? stack->snext : stack);
+       else if(!strncmp(arg, "prev", 5)) {
+               for(c = stack; c && c->snext; c = c->snext);
+               focus(c ? c : stack);
+       }
+}
+
+void
+kill(void *aux)
 {
        Client *c = stack;