Linux Magazine: Conference Report + Scripting KDE with DCOP

In its November 2003 issue, Linux Magazine publishes several KDE related articles of which two are also available online in PDF format. The first, titled "There's an aim called 3.2" looks back on the KDE Contributor Conference and asks again several developers what they really accomplished during the hack fest. In "Boost your efficiency" Scott Wheeler describes how you can easily write scripts which use DCOP to control your KDE desktop and help you save much work.


...what's the picture of the guy with the weird shirt and the iron about????

By Roberto Alsina at Mon, 2003/10/06 - 5:00am

I guess my "pale geek with long hair" look wasn't quite exciting enough to make it. I would have even been willing to hold an appliance on request though as I'm currently inbetween (cough) irons it would have had to have been a coffee grinder or something. :-)

By Scott Wheeler at Mon, 2003/10/06 - 5:00am

I understand your position, since I have not owned an iron in... well, I have never owned an iron. I suggest in your curriculum you include a copy of this article and say it came from "irons monthly".

By Roberto Alsina at Mon, 2003/10/06 - 5:00am

But what do you do when your ties get crumpled? ;)

By Navindra Umanee at Mon, 2003/10/06 - 5:00am

If I gave away my sister at her wedding without a tie, I think I can get through life without ties :-)

Here's some ideas:

a) T-shirts, Mao shirts, polo shirts, other shirts
b) neck braces
c) Borrow a tie
e) buy a new tie if I really really really need one

I've never tried b) yet, and only got to e) once.

Then I had to beg someone to tie my tie for me, because I have forgotten how it's done :-) But that was like two years ago.

By Roberto Alsina at Mon, 2003/10/06 - 5:00am

Yep. I had this crappy job when I was very young where ties were compulsory, but otherwise I'm as anti-tie as they get and I've since never worn a tie for any other social or work reasons...

> Then I had to beg someone to tie my tie for me, because I have forgotten how it's done

Do you know of any ties that don't require tying? Like, elastic or buttoned or something? That could come in useful for emergencies.

Btw, I don't have an iron either... :)

By Navindra Umanee at Mon, 2003/10/06 - 5:00am

He is cute, half Matrix look, and that jeopard couch must be confortable per fare l'amore.

By Gigi, il gaio at Tue, 2003/10/07 - 5:00am

Actually, change him out for konqi.
Might make for an interesting pix.

By a.c. at Wed, 2003/10/08 - 5:00am

I learned a lot ;)

By Alex at Tue, 2003/10/07 - 5:00am

DCOP is not *half* as famous as it should be. People talk all the time about Bonobo and never use it. People never talk about DCOP but DCOP is used to do *magic*. Magic, I tells ya.

By ac at Tue, 2003/10/07 - 5:00am

bonobo is not the same thing as dcop anyways. it's more like gnome's equivalent of kparts. gnome uses CORBA/ORBiT instead of dcop. there is no equiv of dcop's CLI or GUI frontends however.

By anon at Tue, 2003/10/07 - 5:00am

Yes, a famous saying goes like "Any sufficiently advanced technology is indistinguishable from a really cool DCOP script."

By Haakon Nilsen at Tue, 2003/10/07 - 5:00am

Does anyone know how I can get the window that is currently in focus? I want to grab the web page that a person is viewing when they do. Then look up the associated rdf file for the web page, and provide a list of the rdf links for that web page in a small app. This is for people who find it hard to move their hands. They could navigate a web page like slashdot by saying the title number (e.g. 1. 'title 1..' 2. 'title 2...' and so on)

By JohnFlux at Tue, 2003/10/07 - 5:00am

Well, here's a bash script to get the currently active Konqueror. What you're talking about becomes non-trivial, but this might get you going. Sorry for the lack of formatting -- the Dot's text input doesn't allow formatting characters (i.e.  )


for i in `dcop | grep konqueror` ; do
for j in `dcop $i | grep mainwindow` ; do
if [ `dcop $i $j isActiveWindow` == "true" ] ; then
echo $i is the currently active Konqueror.
echo There is no currently active Konqueror.

By Scott Wheeler at Tue, 2003/10/07 - 5:00am

Thanks, but my konqueror doesn't know the function isActiveWindow
$ dcop konqueror-2885 konqueror-mainwindow#1 isActiveWindow
no such function
Kde 3.1.3

This is what I get from
$ dcop konqueror-2885 konqueror-mainwindow#1

QCStringList interfaces()
QCStringList functions()
void openURL(QString url)
int viewCount()
int activeViewsCount()
DCOPRef currentView()
DCOPRef currentPart()
DCOPRef action(QCString name)
QCStringList actions()
QMap actionMap()

By Dee at Tue, 2003/10/07 - 5:00am

I think for newbies, it will be nice if all KDE applications has a macro recorder that can generate DCOP scripts.

But maybe it will be duplicated of what QSA can offer?

By tofu at Tue, 2003/10/07 - 5:00am

I have this horrifying vision of someone naming it kASS.

The Mac zealots in the audience will get the joke.

By Shane Simmons at Wed, 2003/10/08 - 5:00am

dcop klipper klipper setClipboardContents "`cat file_you_want_to_copy`"

nice article

By anonymous coward at Tue, 2003/10/07 - 5:00am

Tried that, oh, say with a file with more than one line? ;-)

By Scott Wheeler at Tue, 2003/10/07 - 5:00am


I use that regularily that way I believe at least :-)

Yours, Kay

By Debian User at Tue, 2003/10/07 - 5:00am

yes. tried it again with a file which has 213 lines. works fine

By anonymous coward at Tue, 2003/10/07 - 5:00am

Ah, doesn't work with all shells (I use tcsh.), but it does seem to work with bash (after one test).

By Scott Wheeler at Wed, 2003/10/08 - 5:00am


if it works with POSIX shells, it's good enough. The csh family is a bastard anyway ;-)

Yours, Kay

By Debian User at Wed, 2003/10/08 - 5:00am

It really urks me that so many Linux related pdfs are written using non-Linux tools. Are we production quality or not?

By Mike at Wed, 2003/10/08 - 5:00am


when we stoped using Linux to proof it could be used, we showed it was ready for production.

Honestly, why have to use Linux for relatively simple tasks like that?!

Yours, Kay

By Debian User at Wed, 2003/10/08 - 5:00am

Are you saying that the only reason to use Linux is to "prove" something? I'm sure you're not, but that's easy to read into your statement. We use Linux because we prefer it over the alternatives for various reasons, and the reason some alternative was used for the PDF has probably got to do, as was suggested, with workflow processes or something other instead.

By Haakon Nilsen at Thu, 2003/10/09 - 5:00am


English makes it hard to recognize conditional things some time. I of course meant "when we would stop" which can be expressed as "when we stoped". But I also wanted to express that we stoped actually already.

Nobody needs to use Linux over other platforms to prove it can do something the other can. I can. But we are still free to take work flow preferences.

Yours, Kay

By Debian User at Thu, 2003/10/09 - 5:00am

In this particular case, the answer is simple: workflow. The pdfs are generated out of the DTP program we use, and as for today there is no such thing as a production ready Linux DTP program suitable for magazines. We hope, Scribus will get there one day, but for the moment we have to stick to MacOS for this task. (FYI: This publisher is a MS free zone, everything apart from layout related tasks is done using Linux :)

By Patricia Jung at Thu, 2003/10/09 - 5:00am

For DTP, I guess I can understand it. However, I see a lot of other Linux related pdfs that could have easily been written in OOo or LaTeX if the time had been put into it.

Here we are telling the world how great our software is, and then we don't even use it.

By Mike at Thu, 2003/10/09 - 5:00am

>>However, I see a lot of other Linux related pdfs that could have easily been written in OOo or LaTeX if the time had been put into it.<<

The problem is not that it is impossible. The problem is that it is too difficult and uncomfortable, especially LaTex. But also OOo is, while certainly not bad for its costs, much worse than MS Word.
Many people use the tools that make them most productive and do not use free software just for the sake of it.

By Jeff Johnson at Thu, 2003/10/09 - 5:00am

I can't see your case for MS Word being better then OOWriter. For almost all uses many people comfortable with both programs prefer the latter. Only people who don't really know and use OOwriter, such as you, would claim that it is "much worse".

As we are talking about PDF creation: This is impossible to do using MSWord. Microsoft software can't do it. (I know distiller and Freepdf, but those are not part of MSWord, you might as well use CrossOver and kprinter....)
In OpenOffice it is one click!

By Moritz Moeller-... at Thu, 2003/10/09 - 5:00am

Sorry for telling the truth, but we're definitely not. 'Linux' stuff works, but it can not compete. At least if you compare the price of the commercial offerings.

By Jeff Johnson at Thu, 2003/10/09 - 5:00am

on DCOP calls woudn't hurt...

For example, ksmserver->ksmserver->logout(int, int, int) does not tell me what each int means... The first time I tried this it promptly rebooted the ltsp server, while there were people logged in...

By Vodka at Fri, 2003/10/10 - 5:00am

The first int is the parameter, which turns interactivity on or off. If it is 0, the ksmserver does not ask if logout command should be executed or not. If the first param is != 0 the ksmserver asks.
The second param is the logout command. 0 means 'logout' from currentkde session. 1 means 'reboot of system and 2 means shutdown of system.
The third param is still unknown for me. Maybe it is some kind of timer, but I am not sure. I will look through the sources (if I find them) and try to find out what this third param means.
I hope that that was a little bit of help for you.

By PinguinPfleger at Wed, 2004/05/05 - 5:00am

Bit late posting, but does anyone know if there's a kdebindings binary rpm floating around for Mandrake 9.1, without forking out for Mandrake club? I realise KDE has nothing to do with building binary releases - just curious if anyone could help - Rpmfind doesn't seem to find anything.

By Frustrated at Fri, 2003/10/10 - 5:00am

I wonder if a perl script could be written to "discover" a local samba network and automatically create links in the kfmclient (kde file manager) for the shares? Similar to the way the old Corel file manager "self discovered" and configured itself for windows networking.

I really think that would be a good thing.

By james at Mon, 2003/10/13 - 5:00am

What's wrong with lisa? Shares are automatically in the "network" tab, as long as your samba's working.

By Rube at Mon, 2003/11/10 - 6:00am