IBM developerWorks: Connect KDE applications using DCOP

Martyn Honeyford from IBM's UK Labs introduces KDE's desktop communication protocol (DCOP) on the IBM developerWorks site. He describes how to utilize it with the graphical kdcop and the command line dcop utilities with several examples such as instantly messaging a contact in Kopete when he comes online and also how to create a simple DCOP-aware application.

Dot Categories: 

Comments

by Nicolas Blanco (not verified)

this is a great article for those who want to discover DCOP !
Thanks Martyn.

I would like to know if it is possible with DCOP to get all the windows names that are opened in the kicker and force an application to "blink" in the kicker.
I would like to create a script for a non-KDE application that notify the user for an event in the application.
thanks if you have any idea.

by Anonymous (not verified)

Should be possible with one of the "dcop knotify default notify" functions if you know the right parameters. Who knows these? :-)

by David Faure (not verified)

From kdelibs/arts/knotify/notify.h:

void notify(const QString &event, const QString &fromApp,
const QString &text, QString sound, QString file,
int present, int level, int winId, int eventId);

No idea what they mean though :)

by Krishna Sethuraman (not verified)

Here you go:

dcop knotify Notify notify notify Me "Segmentation fault!" nosound nofile 2 0

From http://women.kde.org/tips/kdetips.php .

by AC (not verified)

I wonder why the article didn't use 'dcopstart'. It seems to me that this:
konqueror &
dcop konqueror-$! etc

would have a tendency to break, depending on how fast konqueror started up.

by milan (not verified)

Hello,
How is possible to bring a window in front of others?
eg. bring Konsole window to top.

Thanks.

by he-sk (not verified)

dcop_id = `dcop | grep konsole | head -n 1`
dcop $dcop_id konsole-mainwindow#1 raise
dcop $dcop_id konsole-mainwindow#1 focus

Or something along the lines should do it.

by Idan Waisman (not verified)

First, this is an inspiring article. But the first thing I wanted to script is mystifyingly elusive.

Is there a way to determine a particular window's current virtual desktop? The idea being to, upon some event, check to see if that window is on a different desktop and, if so, move it to the current desktop.

Searching the DCOP methods I cannot find any way to do this. I have found no information anywhere pertaining to the manipulation of virtual desktop related info via DCOP, sadly.

Thanks.