#!/bin/zsh # # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! # # Dumps the windows and groups so that ratpoison can be restarted. # Meant to be run from the restart-hook, and creates a script that should be run at startup. # # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! RP_WIN_FILE=.ratpoison-restore-windows echo "ratpoison --command gdelete" > $RP_WIN_FILE for i in 1 2 3 4 5 6 echo "ratpoison --command gdelete" >> $RP_WIN_FILE # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! groupnums=`ratpoison --command groups |sed 's/^\([0-9]*\).*$/\1/'|sort -n` for g in `echo $groupnums` { echo looping groups: $g ratpoison --command "gselect $g" # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! groupname=`ratpoison --command groups|egrep '^[0-9]*\*' |sed 's/^[0-9]*\*\(.*\)$/\1/'` [ "$groupname" != "default" ] && echo "ratpoison --command \"gnew $groupname\"" >> .ratpoison-restore-windows windownums=`ratpoison --command windows|sed 's/^\([0-9]*\).*$/\1/'` for w in `echo $windownums` { echo looping windows: $w ratpoison --command "select $w" windowid=`(xwininfo|grep "xwininfo: Window id:"|sed 's/^xwininfo: Window id: \([0-9a-fx]*\).*/\1/') & sleep 2; ratpoison --command ratclick\ 1` windowname=`ratpoison --command windows|egrep '^[0-9]*\*' |sed 's/^[0-9]*\*\(.*\)$/\1/'` ratpoison --command "title $windowid|$windowname" # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! echo "ratpoison --command \"gselect default\"" >> .ratpoison-restore-windows echo "ratpoison --command \"select $windowid\"" >> .ratpoison-restore-windows echo "ratpoison --command \"gmove $groupname\"" >> .ratpoison-restore-windows echo "ratpoison --command \"gselect $groupname\"" >> .ratpoison-restore-windows echo "ratpoison --command \"select $windowid\"" >> .ratpoison-restore-windows echo "ratpoison --command \"number $w\"" >> .ratpoison-restore-windows echo "ratpoison --command \"title $windowname\"" >> .ratpoison-restore-windows } } # !!!!!! THIS SCRIPT DOES NOT WORK !!!!!!!!!! ratpoison --command "gselect default" ratpoison --command "next" ratpoison --command "echo Window dumping done"