From f4db0019b2d77c9815491bfe10fec65cb6857d2f Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Sat, 11 Mar 2006 20:37:29 +0100 Subject: [PATCH] $MODKEY-space is toggle between floating and managed mode, $MODKEY-Shift-space is 'sendto toggle' --- cmd/wm/area.c | 7 ++++++- cmd/wm/client.c | 6 ++++++ rc/wmiirc | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmd/wm/area.c b/cmd/wm/area.c index dbb0568e..134a1915 100644 --- a/cmd/wm/area.c +++ b/cmd/wm/area.c @@ -73,7 +73,12 @@ select_area(Area *a, char *arg) int i = area2index(a); if(i == -1) return; - if(!strncmp(arg, "prev", 5)) { + if(!strncmp(arg, "toggle", 7)) { + if(i) + i = 0; + else + i = 1; + } else if(!strncmp(arg, "prev", 5)) { if(i == 1) i = t->narea - 1; else if(i != 0) diff --git a/cmd/wm/client.c b/cmd/wm/client.c index 6f44bf41..1dbe35ee 100644 --- a/cmd/wm/client.c +++ b/cmd/wm/client.c @@ -510,6 +510,12 @@ send2area_client(Client *c, char *arg) else to = t->area[1]; } + else if(!strncmp(arg, "toggle", 7)) { + if(i) + to = t->area[0]; + else + to = t->area[1]; + } else { i = cext_strtonum(arg, 0, t->narea - 1, &errstr); if(errstr) diff --git a/rc/wmiirc b/rc/wmiirc index 31751a2c..058a09ac 100644 --- a/rc/wmiirc +++ b/rc/wmiirc @@ -143,9 +143,9 @@ do $MODKEY-Shift-Return) xwrite /ws/sel/sel/ctl sendto next;; $MODKEY-space) - xwrite /ws/sel/sel/ctl sendto 0;; + xwrite /ws/sel/ctl select toggle;; $MODKEY-Shift-space) - xwrite /ws/sel/sel/ctl sendto 1;; + xwrite /ws/sel/sel/ctl sendto toggle;; $MODKEY-h) xwrite /ws/ctl select prev;; $MODKEY-l)