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.

Dot Categories: 


by Roberto Alsina (not verified)

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

by Scott Wheeler (not verified)

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 Roberto Alsina (not verified)

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 Navindra Umanee (not verified)

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

by Roberto Alsina (not verified)

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 Navindra Umanee (not verified)

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 Gigi, il gaio (not verified)

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

by a.c. (not verified)

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

by Alex (not verified)

I learned a lot ;)

by ac (not verified)

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 anon (not verified)

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 Haakon Nilsen (not verified)

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

by JohnFlux (not verified)

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 Scott Wheeler (not verified)

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 Dee (not verified)

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 tofu (not verified)

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 Shane Simmons (not verified)

I have this horrifying vision of someone naming it kASS.

The Mac zealots in the audience will get the joke.

by anonymous coward (not verified)

dcop klipper klipper setClipboardContents "`cat file_you_want_to_copy`"

nice article

by Scott Wheeler (not verified)

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

by Debian User (not verified)


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

Yours, Kay

by anonymous coward (not verified)

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

by Scott Wheeler (not verified)

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

by Debian User (not verified)


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

Yours, Kay

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


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 Haakon Nilsen (not verified)

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.


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 Patricia Jung (not verified)

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 :)

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.

>>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 Moritz Moeller-... (not verified)

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!

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 Vodka (not verified)

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 PinguinPfleger (not verified)

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 Frustrated (not verified)

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 james (not verified)

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 Rube (not verified)

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