Re: Saving and restoring an old panel state





On Wed, 18 Aug 1999 16:38:57 Peter Wainwright wrote:
> I'm afraid that the panel is still not completely stable (particularly if you do
> stupid stuff that crashes X or uses up all the memory). Because of the way
> the panel saves its session, sometimes you can end up with your settings
> lost.
> 
> So, I wrote a couple of trivial scripts to save a good panel state, and
> then restore it if necessary:
> 
> wainwright$ cat ~/bin/backup_panel
> #!/bin/sh
> cd ~/.gnome/panel.d
> set `ls -1dt Session-* | grep -v backup`
> dir=$1
> echo "Backing up $dir"
> rm -f backup/*
> cp -p $dir/* backup
> for f in backup/*; do
> 	sed -e "s/$dir/backup/g" $f > temp_file
> 	if ! diff temp_file $f; then mv -f temp_file $f; fi
> done
> 
> 
> wainwright$ cat `which restore_panel`
> #! /bin/sh
> cd ~
> killall panel
> sleep 10
> xprop -root -remove GNOME_PANEL
> if [ "$1" != "" ]; then
> smid="$1"
> else
> smid=backup
> fi
> nohup panel --sm-config-prefix /panel.d/"$smid"/ </dev/null >/dev/null 2>&1 &
> 

Sorry, I forgot to mention: when restore_panel kills the existing panel,
the session manager will try to restart it. However, it will find the 
property GNOME_PANEL on the root window, and give you that irritating
(and erroneous) prompt about finding an existing panel. You have to answer
"no" to this. Your backup panel will restart after a decent interval (10s).


> 
> 
> Peter Wainwright
> Home: prw@wainpr.demon.co.uk     Work: peter.wainwright@nrpb.org.uk
> http://www.wainpr.demon.co.uk    Fax: +44-870-052-3185
> Visit the Opera Exchange Homepage at http://www.treda.co.uk/opex/

Peter Wainwright
Home: prw@wainpr.demon.co.uk     Work: peter.wainwright@nrpb.org.uk
http://www.wainpr.demon.co.uk    Fax: +44-870-052-3185
Visit the Opera Exchange Homepage at http://www.treda.co.uk/opex/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]