summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-05-14 16:24:05 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-05-14 16:24:05 +0000
commit87cd10f42952a279504e120e3856f9224b4e1514 (patch)
tree0d3b6ea8cf0036a093923e3b787b8b6fc45cff65 /app/cwm
parent9eccded309dacafe5ad0904e01d5224996f91d9f (diff)
Add a new command (currently no default keybindings for it), grouponly[1-9].
This works like the group select binding, but hides all other groups. So, the people who've been complaining that they don't get "virtual desktops" in cwm may want to try this out in cwmrc (from memory, untested): --- #cwmrc # add new windows to the current group set sticky # automatically sticky windows. xclock for now. # to make more windows sticky use group_toggle to unset their group autogroup 0 xclock # make the group selection keys hide other groups, emulate virtual desktops bind CM-1 grouponly1 bind CM-2 grouponly2 bind CM-3 grouponly3 bind CM-4 grouponly4 bind CM-5 grouponly5 bind CM-6 grouponly6 bind CM-7 grouponly7 bind CM-8 grouponly8 bind CM-9 grouponly9 --- mostly by sthen, tweaks from me. ok todd@, "if it works i'm ok with it" okan@, ok sthen@
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/calmwm.h4
-rw-r--r--app/cwm/conf.c11
-rw-r--r--app/cwm/cwmrc.58
-rw-r--r--app/cwm/group.c19
-rw-r--r--app/cwm/kbfunc.c8
5 files changed, 44 insertions, 6 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index f512ebcec..3ea85c865 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.h,v 1.84 2009/04/15 14:01:45 okan Exp $
+ * $Id: calmwm.h,v 1.85 2009/05/14 16:24:04 oga Exp $
*/
#ifndef _CALMWM_H_
@@ -438,6 +438,8 @@ void kbfunc_cmdexec(struct client_ctx *, union arg *);
void kbfunc_client_label(struct client_ctx *, union arg *);
void kbfunc_client_delete(struct client_ctx *, union arg *);
void kbfunc_client_group(struct client_ctx *, union arg *);
+void kbfunc_client_grouponly(struct client_ctx *,
+ union arg *);
void kbfunc_client_cyclegroup(struct client_ctx *,
union arg *);
void kbfunc_client_nogroup(struct client_ctx *,
diff --git a/app/cwm/conf.c b/app/cwm/conf.c
index ac4097ff9..dd4b59739 100644
--- a/app/cwm/conf.c
+++ b/app/cwm/conf.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: conf.c,v 1.58 2009/05/04 19:13:33 okan Exp $
+ * $Id: conf.c,v 1.59 2009/05/14 16:24:04 oga Exp $
*/
#include "headers.h"
@@ -272,6 +272,15 @@ struct {
{ "group7", kbfunc_client_group, 0, {.i = 7} },
{ "group8", kbfunc_client_group, 0, {.i = 8} },
{ "group9", kbfunc_client_group, 0, {.i = 9} },
+ { "grouponly1", kbfunc_client_grouponly, 0, {.i = 1} },
+ { "grouponly2", kbfunc_client_grouponly, 0, {.i = 2} },
+ { "grouponly3", kbfunc_client_grouponly, 0, {.i = 3} },
+ { "grouponly4", kbfunc_client_grouponly, 0, {.i = 4} },
+ { "grouponly5", kbfunc_client_grouponly, 0, {.i = 5} },
+ { "grouponly6", kbfunc_client_grouponly, 0, {.i = 6} },
+ { "grouponly7", kbfunc_client_grouponly, 0, {.i = 7} },
+ { "grouponly8", kbfunc_client_grouponly, 0, {.i = 8} },
+ { "grouponly9", kbfunc_client_grouponly, 0, {.i = 9} },
{ "nogroup", kbfunc_client_nogroup, 0, {0} },
{ "cyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_CYCLEGROUP} },
{ "rcyclegroup", kbfunc_client_cyclegroup, 0, {.i = CWM_RCYCLEGROUP} },
diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5
index 7b822a907..e6d338876 100644
--- a/app/cwm/cwmrc.5
+++ b/app/cwm/cwmrc.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cwmrc.5,v 1.22 2009/05/04 22:01:35 okan Exp $
+.\" $OpenBSD: cwmrc.5,v 1.23 2009/05/14 16:24:04 oga Exp $
.\"
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 4 2009 $
+.Dd $Mdocdate: May 14 2009 $
.Dt CWMRC 5
.Os
.Sh NAME
@@ -242,6 +242,10 @@ Launch
menu.
.It group[n]
Select group n, where n is 1-9.
+.It grouponly[n]
+Like
+.Ar group[n]
+but also hides the other groups.
.It nogroup
Select all groups.
.It grouptoggle
diff --git a/app/cwm/group.c b/app/cwm/group.c
index ffe6b5f6f..fb7b7b7b2 100644
--- a/app/cwm/group.c
+++ b/app/cwm/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: group.c,v 1.23 2009/01/27 00:42:53 oga Exp $
+ * $Id: group.c,v 1.24 2009/05/14 16:24:04 oga Exp $
*/
#include "headers.h"
@@ -213,6 +213,23 @@ group_hidetoggle(int idx)
}
}
+void
+group_only(int idx)
+{
+ int i;
+
+ if (idx < 0 || idx >= CALMWM_NGROUPS)
+ err(1, "group_only: index out of range (%d)", idx);
+
+ for (i = 0; i < CALMWM_NGROUPS; i++) {
+ if (i == idx) {
+ _group_show(&Groups[i]);
+ } else {
+ _group_hide(&Groups[i]);
+ }
+ }
+}
+
/*
* Cycle through active groups. If none exist, then just stay put.
*/
diff --git a/app/cwm/kbfunc.c b/app/cwm/kbfunc.c
index 48eea820f..04ee7f4c9 100644
--- a/app/cwm/kbfunc.c
+++ b/app/cwm/kbfunc.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: kbfunc.c,v 1.36 2009/02/07 21:07:00 martynas Exp $
+ * $Id: kbfunc.c,v 1.37 2009/05/14 16:24:04 oga Exp $
*/
#include <paths.h>
@@ -439,6 +439,12 @@ kbfunc_client_group(struct client_ctx *cc, union arg *arg)
}
void
+kbfunc_client_grouponly(struct client_ctx *cc, union arg *arg)
+{
+ group_only(KBTOGROUP(arg->i));
+}
+
+void
kbfunc_client_cyclegroup(struct client_ctx *cc, union arg *arg)
{
group_cycle(arg->i);