diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | contrib/Makefile.am | 4 | ||||
-rw-r--r-- | contrib/rpshowall.sh | 51 |
3 files changed, 50 insertions, 10 deletions
@@ -1,3 +1,8 @@ +2003-11-22 Shawn Betts <sabetts@vcn.bc.ca> + + * contrib/Makefile.am (pkgdata_DATA): add rpshowall.sh + (EXTRA_DIST): likewise + 2003-11-17 Shawn Betts <sabetts@vcn.bc.ca> * contrib/rpshowall.sh: store ratpoison binary location in diff --git a/contrib/Makefile.am b/contrib/Makefile.am index a58bfaa..58c6e5d 100644 --- a/contrib/Makefile.am +++ b/contrib/Makefile.am @@ -1,4 +1,4 @@ bin_SCRIPTS = rpws -pkgdata_DATA = ratpoison.el split.sh genrpbindings rpws allwindows.sh clickframe.pl -EXTRA_DIST = ratpoison.el split.sh genrpbindings rpws allwindows.sh clickframe.pl +pkgdata_DATA = ratpoison.el split.sh genrpbindings rpws allwindows.sh clickframe.pl rpshowall.sh +EXTRA_DIST = ratpoison.el split.sh genrpbindings rpws allwindows.sh clickframe.pl rpshowall.sh diff --git a/contrib/rpshowall.sh b/contrib/rpshowall.sh index b4d8570..487ad90 100644 --- a/contrib/rpshowall.sh +++ b/contrib/rpshowall.sh @@ -2,16 +2,39 @@ # rpshowall # ratpoison script to show all open windows -# 2003 Florian Cramer <cantsin@zedat.fu-berlin.de> +# Copyright (C) 2003 Florian Cramer <cantsin@zedat.fu-berlin.de> + +# Usage : +# +# rpshowall [no arguments] +# if called from a terminal, show all open windows and +# restore previous frame layout upon keystroke +# +# rpshowall [n>1] +# show all open windows for n seconds, +# then restore previous frame layout +# +# rpshowall 0 +# show all open windows, do not restore previous frame layout if [ -z $RATPOISON ]; then RATPOISON=ratpoison fi + +# Parse input argument + +if [ $*>0 ]; then + wait="$*" +else + wait=-1 +fi + + # 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'`" +curframe=`$RATPOISON -c windows | grep "^[0-9]*\*" | sed -e "s/^\([0-9]*\).*/\1/"` +curlayout=`$RATPOISON -c fdump` # Create split view of all open windows @@ -29,10 +52,22 @@ while [ $i -le $framecount ]; do i=$[$i+1]; done - -# Restore frameset +# Depending on the argument the script was executed with, +# 1- select a new window and exit opening it fullscreen +# 2- restore frameset after keyboard input +# 3- restore frameset after $wait seconds of delay $RATPOISON -c "select $curframe" -echo -n "Restore window layout... " -read i -$RATPOISON -c "frestore `$RATPOISON -c 'getenv tmp'`" +if [ $wait -eq 0 ]; then + $RATPOISON -i -c fselect + $RATPOISON -c only +else + $RATPOISON -i -c windows + if [ $wait -eq -1 ]; then + echo -n "Hit return to restore window layout. " + read i + else + sleep $wait + fi + $RATPOISON -c "frestore $curlayout" +fi |