summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
Diffstat (limited to 'group.c')
-rw-r--r--group.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/group.c b/group.c
index 29647ac..73f742d 100644
--- a/group.c
+++ b/group.c
@@ -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.
  */