summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS4
-rw-r--r--contrib/Makefile.am4
-rwxr-xr-xcontrib/allwindows.sh38
3 files changed, 44 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 0cd8be9..5e3f6d0 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,9 @@
ratpoison NEWS --- history of user-visible changes. -*- outline -*-
+* Changes since 1.3.0-beta2
+** contrib/allwindows.sh script
+A script that lists all groups and the windows in each group.
+
* Changes since 1.2.2
** Workspace script
rpws is an installed script that adds workspaces to ratpoison. Look at
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 50c50ad..160a69b 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,4 +1,4 @@
bin_SCRIPTS = rpws
-pkgdata_DATA = ratpoison.el split.sh genrpbindings rpws
-EXTRA_DIST = ratpoison.el split.sh genrpbindings rpws
+pkgdata_DATA = ratpoison.el split.sh genrpbindings rpws allwindows.sh
+EXTRA_DIST = ratpoison.el split.sh genrpbindings rpws allwindows.sh
diff --git a/contrib/allwindows.sh b/contrib/allwindows.sh
new file mode 100755
index 0000000..995f367
--- /dev/null
+++ b/contrib/allwindows.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Copyright (C) 2003 Rupert Levene
+# Author: Rupert Levene <r.levene@lancaster.ac.uk>
+
+# List all groups and the windows in each group.
+
+# we want to cope with spaces in group names
+IFS='
+'
+
+#initialize our list
+list=''
+
+# Allow external scripts to tell it where ratpoison is
+if [ -z $RATPOISON ]; then
+ RATPOISON=ratpoison
+fi
+
+GROUPLIST=$($RATPOISON -c groups)
+SED_GET_NUM='s/^\([0-9]*\).*/\1/'
+
+FIRSTGROUPNUM=$(echo "$GROUPLIST"|head -1|sed -e "$SED_GET_NUM")
+LASTGROUP=$(echo "$GROUPLIST"|tail -1)
+CURRENTGROUPNUM=$(echo "$GROUPLIST"|grep '^[0-9]*\*'|sed -e "$SED_GET_NUM")
+
+$RATPOISON -c "gselect $FIRSTGROUPNUM"
+
+for i in $GROUPLIST; do
+ list=$(printf '%s%s\n%s' "$list" "$i" "$($RATPOISON -c windows|sed -e 's/^/ /')");
+ if [ "$i" != "$LASTGROUP" ]; then
+ list="${list}
+"
+ fi
+ $RATPOISON -c gnext
+done;
+
+$RATPOISON -c "echo $list"
+$RATPOISON -c "gselect $CURRENTGROUPNUM"