This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Control kwin effects with qdbus?

Tags: kwin, dbus kwin, dbus kwin, dbus
(comma "," separated)
attunezero
Registered Member
Posts
1
Karma
0

Control kwin effects with qdbus?

Thu Mar 05, 2009 3:04 pm
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?
peaches
Registered Member
Posts
31
Karma
1
dunno. i send the hotkey to 'xmacroplay'
i dont have any kdeglobalaccel module, kde svn
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
It doesn't work probably because it is a signal, which is to be connected to by other applications to recieve events.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell