2006-07-11 12:53:22 +00:00
|
|
|
/*
|
|
|
|
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
|
|
|
* See LICENSE file for license details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wm.h"
|
|
|
|
#include <stdio.h>
|
2006-07-11 16:15:11 +00:00
|
|
|
#include <string.h>
|
2006-07-11 12:53:22 +00:00
|
|
|
|
|
|
|
void
|
2006-07-11 16:15:11 +00:00
|
|
|
run(void *aux)
|
2006-07-11 12:53:22 +00:00
|
|
|
{
|
2006-07-11 16:15:11 +00:00
|
|
|
spawn(dpy, aux);
|
2006-07-11 12:53:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2006-07-11 16:15:11 +00:00
|
|
|
quit(void *aux)
|
2006-07-11 12:53:22 +00:00
|
|
|
{
|
|
|
|
running = False;
|
|
|
|
}
|
2006-07-11 14:14:22 +00:00
|
|
|
|
2006-07-11 22:00:25 +00:00
|
|
|
void
|
|
|
|
sel(void *aux)
|
|
|
|
{
|
|
|
|
const char *arg = aux;
|
2006-07-12 13:17:22 +00:00
|
|
|
Client *c = NULL;
|
2006-07-11 22:00:25 +00:00
|
|
|
|
|
|
|
if(!arg || !stack)
|
|
|
|
return;
|
|
|
|
if(!strncmp(arg, "next", 5))
|
2006-07-12 13:17:22 +00:00
|
|
|
c = stack->snext ? stack->snext : stack;
|
|
|
|
else if(!strncmp(arg, "prev", 5))
|
2006-07-11 22:00:25 +00:00
|
|
|
for(c = stack; c && c->snext; c = c->snext);
|
2006-07-12 13:17:22 +00:00
|
|
|
if(!c)
|
|
|
|
c = stack;
|
|
|
|
raise(c);
|
|
|
|
focus(c);
|
2006-07-11 22:00:25 +00:00
|
|
|
}
|
|
|
|
|
2006-07-11 14:14:22 +00:00
|
|
|
void
|
2006-07-11 16:15:11 +00:00
|
|
|
kill(void *aux)
|
2006-07-11 14:14:22 +00:00
|
|
|
{
|
|
|
|
Client *c = stack;
|
|
|
|
|
|
|
|
if(!c)
|
|
|
|
return;
|
|
|
|
if(c->proto & WM_PROTOCOL_DELWIN)
|
|
|
|
send_message(c->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
|
|
|
|
else
|
|
|
|
XKillClient(dpy, c->win);
|
|
|
|
}
|
|
|
|
|