Compiz and suspend problems

I have an HP Pavilion DV6855el with Opensuse 11 and compiz-fusion.
Suspend to ram and to disk work fine, however after resume I lose window borders in X and I have to restart compiz manually; I read the pm-utils howto to create a custom hook to restart compiz, but I couldn’t solve my problem, since all the hooks must be run as root and I get a “GTK: cannot open display” error when I try to launch compiz using sudo

Here’s the script I tried to use:

case $1 in
echo “Hey guy, we are going to suspend to disk!”
echo “Oh, this time we’re doing a suspend to RAM. Cool!”
echo “oh, suspend to disk is over, we are resuming…”
su francesco -c 'xhost local:francesco; emerald --replace & ’
echo “hey, the suspend to RAM seems to be over…”
su francesco -c 'xhost local:francesco; emerald --replace & ’
*) echo “somebody is calling me totally wrong.”

Any help will be appreciated :slight_smile:

Thanks in advance