wmii

git clone git://oldgit.suckless.org/wmii/
Log | Files | Refs | README | LICENSE

commit b3e54e3ae09ae65f8ac3219e920c3ccb4d7cd4de
parent 33ffed72931e6df2fe55b9e39e19695bc7509ec8
Author: Anselm R. Garbe <garbeam@wmii.de>
Date:   Thu, 23 Feb 2006 20:52:55 +0100

implemented cmd 'sendto <page>' in /x/x/x/ctl


Diffstat:
cmd/wm/client.c | 20++++++++++++++++++++
cmd/wm/fs.c | 4++--
cmd/wm/wm.h | 1+
3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/cmd/wm/client.c b/cmd/wm/client.c @@ -584,3 +584,23 @@ select_client(Client *c, char *arg) } focus_client(a->client[i], True); } + +void +send_client(Client *c, char *arg) { + const char *errstr; + Page *p; + int i; + + + if(!strncmp(arg, "new", 4)) + p = alloc_page(); + else { + i = cext_strtonum(arg, 1, npage, &errstr); + if(errstr) + return; + p = page[i - 1]; + } + detach_client(c, False); + focus_page(p); + attach_client(c); +} diff --git a/cmd/wm/fs.c b/cmd/wm/fs.c @@ -1075,8 +1075,8 @@ xwrite(IXPConn *c, Fcall *fcall) cl = page[i1]->area[i2]->client[i3]; if(!strncmp(buf, "kill", 5)) kill_client(cl); - if(!strncmp(buf, "detach", 7)) - detach_client(cl, False); + if(!strncmp(buf, "sendto ", 7)) + send_client(cl, &buf[7]); break; default: break; diff --git a/cmd/wm/wm.h b/cmd/wm/wm.h @@ -224,6 +224,7 @@ unsigned int bar_height(Client *c); int cid_to_index(Area *a, unsigned short id); int client_to_index(Client *c); void select_client(Client *c, char *arg); +void send_client(Client *c, char *arg); /* event.c */ void init_x_event_handler();