summaryrefslogtreecommitdiff
path: root/contrib/allwindows.sh
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-08-11 05:12:48 +0000
committersabetts <sabetts>2003-08-11 05:12:48 +0000
commite8d4782f9666d4355718b2c00ef53c464f676da3 (patch)
tree58edc73a8a1751772fa8592ea5cdae972587b399 /contrib/allwindows.sh
parent8333d4f665d9294bb9a554e9b165207bbce9e8ce (diff)
downloadratpoison-e8d4782f9666d4355718b2c00ef53c464f676da3.zip
*** empty log message ***
Diffstat (limited to 'contrib/allwindows.sh')
-rwxr-xr-xcontrib/allwindows.sh38
1 files changed, 38 insertions, 0 deletions
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"