garbeam@12: /* garbeam@12: * (C)opyright MMVI Anselm R. Garbe garbeam@12: * See LICENSE file for license details. garbeam@12: */ garbeam@12: garbeam@12: #include "wm.h" garbeam@12: #include garbeam@14: #include garbeam@12: garbeam@12: void garbeam@14: run(void *aux) garbeam@12: { garbeam@14: spawn(dpy, aux); garbeam@12: } garbeam@12: garbeam@12: void garbeam@14: quit(void *aux) garbeam@12: { garbeam@12: running = False; garbeam@12: } garbeam@13: garbeam@13: void garbeam@23: sel(void *aux) garbeam@23: { garbeam@23: const char *arg = aux; garbeam@23: Client *c; garbeam@23: garbeam@23: if(!arg || !stack) garbeam@23: return; garbeam@23: if(!strncmp(arg, "next", 5)) garbeam@23: focus(stack->snext ? stack->snext : stack); garbeam@23: else if(!strncmp(arg, "prev", 5)) { garbeam@23: for(c = stack; c && c->snext; c = c->snext); garbeam@23: focus(c ? c : stack); garbeam@23: } garbeam@23: } garbeam@23: garbeam@23: void garbeam@14: kill(void *aux) garbeam@13: { garbeam@13: Client *c = stack; garbeam@13: garbeam@13: if(!c) garbeam@13: return; garbeam@13: if(c->proto & WM_PROTOCOL_DELWIN) garbeam@13: send_message(c->win, wm_atom[WMProtocols], wm_atom[WMDelete]); garbeam@13: else garbeam@13: XKillClient(dpy, c->win); garbeam@13: } garbeam@13: