X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=cmd.c;h=baa3ae94fabe163243c5042e7417643c27712fd3;hp=9ac4e729eab09cbf97efa7fac2000c4a4fcf3c77;hb=dfd84f9bf3b9d949412a73bc62a43109b340d395;hpb=33996500763b04119a6867dfa4040a4236c21a41 diff --git a/cmd.c b/cmd.c index 9ac4e72..baa3ae9 100644 --- a/cmd.c +++ b/cmd.c @@ -5,22 +5,40 @@ #include "wm.h" #include +#include 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 = NULL; + + if(!arg || !stack) + return; + if(!strncmp(arg, "next", 5)) + c = stack->snext ? stack->snext : stack; + else if(!strncmp(arg, "prev", 5)) + for(c = stack; c && c->snext; c = c->snext); + if(!c) + c = stack; + raise(c); + focus(c); +} + +void +kill(void *aux) { Client *c = stack;