aewl

annotate cmd.c @ 26:e8f627998d6f

simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
author Anselm R. Garbe <garbeam@wmii.de>
date Wed, 12 Jul 2006 15:17:22 +0200
parents 95ffdfd0a819
children
rev   line source
garbeam@12 1 /*
garbeam@12 2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
garbeam@12 3 * See LICENSE file for license details.
garbeam@12 4 */
garbeam@12 5
garbeam@12 6 #include "wm.h"
garbeam@12 7 #include <stdio.h>
garbeam@14 8 #include <string.h>
garbeam@12 9
garbeam@12 10 void
garbeam@14 11 run(void *aux)
garbeam@12 12 {
garbeam@14 13 spawn(dpy, aux);
garbeam@12 14 }
garbeam@12 15
garbeam@12 16 void
garbeam@14 17 quit(void *aux)
garbeam@12 18 {
garbeam@12 19 running = False;
garbeam@12 20 }
garbeam@13 21
garbeam@13 22 void
garbeam@23 23 sel(void *aux)
garbeam@23 24 {
garbeam@23 25 const char *arg = aux;
garbeam@26 26 Client *c = NULL;
garbeam@23 27
garbeam@23 28 if(!arg || !stack)
garbeam@23 29 return;
garbeam@23 30 if(!strncmp(arg, "next", 5))
garbeam@26 31 c = stack->snext ? stack->snext : stack;
garbeam@26 32 else if(!strncmp(arg, "prev", 5))
garbeam@23 33 for(c = stack; c && c->snext; c = c->snext);
garbeam@26 34 if(!c)
garbeam@26 35 c = stack;
garbeam@26 36 raise(c);
garbeam@26 37 focus(c);
garbeam@23 38 }
garbeam@23 39
garbeam@23 40 void
garbeam@14 41 kill(void *aux)
garbeam@13 42 {
garbeam@13 43 Client *c = stack;
garbeam@13 44
garbeam@13 45 if(!c)
garbeam@13 46 return;
garbeam@13 47 if(c->proto & WM_PROTOCOL_DELWIN)
garbeam@13 48 send_message(c->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
garbeam@13 49 else
garbeam@13 50 XKillClient(dpy, c->win);
garbeam@13 51 }
garbeam@13 52