aboutsummaryrefslogtreecommitdiffstats
path: root/group.c
diff options
context:
space:
mode:
authoroga2009-05-14 16:24:04 +0000
committeroga2009-05-14 16:24:04 +0000
commitfd1feec244c3d4db7bdb0cd566337b022b3905c7 (patch)
treed2766d20fa95ac2a1f8c5e925ef4505a7b2cc591 /group.c
parent716d8079d9fe53b4c59aea323294ed994000c869 (diff)
downloadcwm-fd1feec244c3d4db7bdb0cd566337b022b3905c7.tar.gz
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 'group.c')
-rw-r--r--group.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/group.c b/group.c
index ffe6b5f..fb7b7b7 100644
--- a/group.c
+++ b/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.
*/