#!/bin/sh #Creates a script called "restore-panel" in the current directory. It overwrites old copies of "restore-panel". #Define paths. restoration_script="restore-panel" #Path of applet restoration script. applet_list="/tmp/applet-list" #Path of temporary file which will contain a list of applets. #Make a list of applets and objects on the panel and put it in the applet list. gconftool-2 --all-dirs /apps/panel/applets > "$applet_list" gconftool-2 --all-dirs /apps/panel/objects >>"$applet_list" #Make the restoration script. echo "#!/bin/sh" > "$restoration_script" #Place this at the top of the restoration script. while read applet do #For each applet/object in the list, get the position, panel_right_stick, and locked values... #...then add a line to the restoration script to reset it. #position position=`gconftool-2 --get $applet/position` echo "gconftool-2 --set $applet/position --type int $position" >> "$restoration_script" #panel_right_stick panel_right_stick=`gconftool-2 --get $applet/panel_right_stick` echo "gconftool-2 --set $applet/panel_right_stick --type bool $panel_right_stick" >> "$restoration_script" #locked locked=`gconftool-2 --get $applet/locked` echo "gconftool-2 --set $applet/locked --type bool $locked" >> "$restoration_script" done <"$applet_list" #Write code to restart the gnome-pannel in the restoration script. echo "killall gnome-panel" >> "$restoration_script" #Make the restoration script executable. chmod +x "$restoration_script" #Delete the applet list since it is no longer needed. rm "$applet_list"