summaryrefslogtreecommitdiff
path: root/contrib/rpshowall.sh
blob: 246524380d1832c7c73ee17f8fb0605e97c29825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

# rpshowall
# ratpoison script to show all open windows 
# 2003 Florian Cramer <cantsin@zedat.fu-berlin.de>


# Save current frameset

framecount=`ratpoison -c windows | wc -l | sed -e "s/[ ]*//g"`
curframe=`ratpoison -c windows | grep "^.\*" | sed -e "s/^\([0-9]*\)\*.*/\1/"`
ratpoison -c "setenv tmp `ratpoison -c 'fdump'`"


# Create split view of all open windows

ratpoison -c only
i=2; 
while [ $i -le $framecount ]; do 
	if [ $i -le `echo $framecount/2 | bc` ] ; then
		ratpoison -c hsplit
	else
		ratpoison -c vsplit
	fi
	ratpoison -c focus
	ratpoison -c focus
	i=$[$i+1];
done


# Restore frameset

ratpoison -c "select $curframe"
echo -n "Restore window layout... "
read i
ratpoison -c "frestore `ratpoison -c 'getenv tmp'`"