backup mailwatch config?

Grant Edwards grant.b.edwards at gmail.com
Mon Sep 20 23:41:45 CEST 2010


On 2010-09-20, Liviu Andronic <landronimirc at gmail.com> wrote:
> On Tue, Jun 8, 2010 at 9:45 PM, Grant Edwards <grant.b.edwards at gmail.com> wrote:
>
>> Can anybody recommend a good replacement for the mailwatch plugin? It
>> crashes several times a day and takes its configuraiton down the
>> drain with it. I've got a script that repairs the panel and mailwatch
>> configurations and restarts things, but it's getting a bit tiresome.
>
> Grant: Could you post your script somewhere? I'm getting mailwatch
> crashes, again, and I'd like to start making backups of the
> configuration.

Here's my script:

------------------------------fixmail.sh------------------------------
#!/bin/bash

xfce4-panel -x
sleep 1.0

cd ~/.config/xfce4/panel
sed '/mailwatch/d' panels.xml >tmp$$-panels.xml
n=1
for f in mailwatch-[A-Za-z]*.rc
  do
  echo $f
  ln -f $f mailwatch-$n.rc
  sed -i "/<item name=\"clock\" id=\"12203813950\".*\$/ a <item name=\"mailwatch\" id=\"$n\"/>" tmp$$-panels.xml
  let n=n+1
  done
mv tmp$$-panels.xml panels.xml

cd ~
xfce4-panel &
----------------------------------------------------------------------

To use it, you copy the working mailwatch-N.rc files to some other
names with text labels instead of the N.

The panel where used to put all my mailwatch instances had a clock in
it and the mailwatch instances were to immediately follow the clock.

What the script does is

 * Stop xfce4-panel

 * Remove all mailwatch instances from the panel config file.
 
 * Link the backup mailwatch-whatever.rc files to mailwatch-1.rc,
   mailwatch-2.rc, etc.

 * Insert the newly "restored" mailwatch-1.rc, mailwatch-2.rc, etc.
   configs into the panel configuration immediately following the
   clock instance with the ID number in the script.  You'll want to
   fix the second 'sed' command so that it inserts the mailwatch
   items in the desired spot in the panel config file.   
  
 * start xfce4-panel
 
> Alternatively, could someone point to which files/dirs should get backed up?

~/.config/xfcer/panel/mailwatch-<id>.rc

Those <id> values have to match up with id values in panel.xml.

-- 
Grant Edwards               grant.b.edwards        Yow! hubub, hubub, HUBUB,
                                  at               hubub, hubub, hubub, HUBUB,
                              gmail.com            hubub, hubub, hubub.




More information about the Xfce mailing list