Wednesday, January 23, 2008

Restart Gnome-Do with Gnome-Do

UPDATE: Now we can by setting the /apps/gnome-do/preferences/enable_updating gconf key to true to resolve this. Thanks Christopher~~

Like the most applications, Gnome-Do can not load the most recent changes you made after you have already launched Gnome-Do. So I wrote this script to resolve this problem. Stupid way, but works, :)

Copy the source code below and save a file named restartdo in /home/[uid]/bin or you wished destination. Then run chmod + x /home/[uid]/bin/restartdo to give this script the ability to execute. Don't forget to replace the [uid] with your user name.

Now, check if your directory already in ~/.do/FileItemSource.config. If not, add in it. Restart your Gnome-Do, try this script, have fun with Gnome-Do.


#!/bin/bash
# vim:sts=4:ai:et:

x=3
while (( x-- > 0 )) && {
killall gnome-do >/dev/null 2>&1
ps x | grep Do | grep -v grep >/dev/null 2>&1
}
do
sleep 3
done

if {
ps x | grep Do | grep -v grep >/dev/null 2>&1
}
then
echo 'Failed to stop Gnome-Do'
return -1
fi

echo 'Gnome-Do stopped'


while ! {
ps x | grep compiz | grep -v grep >/dev/null 2>&1
}
do
sleep 3
done

exec gnome-do >/dev/null 2>&1 &
echo "Gnome-Do started"

2 comments:

oiyus said...

do ur job. don't be stupid!

Òscar said...

cool! What's the compiz part for?