Automatically disable Kwin effects

Is it possible to write a script that will disable kwin composing when I start desired app and enable composing when I close that app?
It can be done with compiz on GNOME:

/usr/bin/metacity --replace &
googleearth
/usr/bin/compiz --replace &

How to make with KDE 4.3?

ALT+SHIFT+F12 toggle composite effects in Kwin4. Maybe you can start from this.

you can install the toggle compositing widget and add it to your task bar it will turn off and on compositing like you so desire

I know about that.
I was asking about a script :stuck_out_tongue:

ok sorry but why use a script when there is something else easier:O

Because my girlfriend will use it :slight_smile: and it will be easier for her if composing will automatically disable and re enable itself after closing Google Earth:P