You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, March 5th 2009, 2:59pm

Control kwin effects with qdbus

Using the latest kubuntu 9.04 alpha (kde 4.2)
I was trying to figure out how to automatically start the "snow" effect on login, but can't seem to figure it out.

dbus-monitor revealed this message when pressing the hotkey to start the effect

signal sender=:1.2 -> dest=(null destination) serial=9552 path=/modules/kdedglobalaccel; interface=org.kde.KdedGlobalAccel; member=invokeAction
array [
string "kwin"
string "Snow"
string "KWin"
string "Snow"
]
int64 46476627

Which really didn't lead me anywhere. It appears to be a dbus signal sent out that invokes the snow effect, but I couldn't figure out how to send it out myself using qdbus.

I also looked at the functions in /usr/share/dbu-1/interfaces/org.kde.KWin.xml but did not find anything I could call with qdbus that would activate the effect. The fucntions in the KWin interface seem to load/unload effects from kwin but not actually run them.

Executing

dbus-send /modules/kdedglobalaccel org.kde.KdedGlobalAccel.invokeAction array:string:"kwin","Snow","KWin","Snow" int64:9999999

results in the following from dbus-monitor

signal sender=org.freedesktop.DBus -> dest=(null destination) serial=18 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.862"
string ""
string ":1.862"
method call sender=:1.862 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
signal sender=:1.862 -> dest=(null destination) serial=2 path=/modules/kdedglobalaccel; interface=org.kde.KdedGlobalAccel; member=invokeAction
array [
string "kwin"
string "Snow"
string "KWin"
string "Snow"
]
int64 9999999
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=19 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
string ":1.862"
string ":1.862"
string ""

Which appears correct, but still does not toggle the snow effect.
Executing

qdbus org.kde.kded /modules/kdedglobalaccel org.kde.KdedGlobalAccel.invokeAction array:string:"kwin","Snow","KWin","Snow" int64:9999999

results in

Error: org.freedesktop.DBus.Error.UnknownMethod
No such method 'invokeAction' in interface 'org.kde.KdedGlobalAccel' at object path '/modules/kdedglobalaccel' (signature 'asx')

however looking at the interface by running

qdbus org.kde.kded /modules/kdedglobalaccel/

reveals the following function

...
signal void org.kde.KdedGlobalAccel.invokeAction(QStringList actionId, qlonglong timestamp)
...

So I don't see why my call to qdbus wont work.

Perhaps im going about this in completely the wrong way? Is there another/easier way to start effects from the command line?