Having fun with dcop

So what is dcop and why am i playing with that.

I have been working over the internet for quite some time now and usually in a day i have over 8 different terminals open to different serves that I’m monitoring, updating, checking, maintaining, or all kind of other stuff. And I need to keep track about what windows is what. I usually uses the konsole application and open all different sessions in different tabs, and sometimes i have more than one windows so its a lot to keep track of.

I have previous used the old “Prompt” trick and changing the shell prompt for different machines, but that was not enogth. For some time i have been changing the tab name but doing this manuallay every time is a bit tideous. I have looked at different ways of chaning the tab name and there are eacape sequences that does it but I have not had a god result.

Some time ago I ceated a number of small scripts for connecting to different servers. One of the reason to do this is that I am using phpmyadmin to connecto to databases that I maintain and work on, so to avoid to keep typing all that I used the small script as i talked about here.

So why not change it to also set the Tab name.

And here is when DCOP comes to help. DCOP is KDE’s IPC/RPC mechanism. In other words is used to communicate between different DCOP aware applications on the KDE desktop. Its quite like the Microsoft Automation system, but it has no means of starting applications or services only runnning applications can be controlled.

The ‘dcop’ program provides command line access to the DCOP system. The syntax is:

To see which applications are available, enter ‘dcop’ with no arguments.

The interesting thing here is that konsole has some integration into this and there are 2 environment variables, KONSOLE_DCOP and KONSOLE_DCOP_SESSION.

So if you in a konsole window run the command:

dcop $KONSOLE_DCOP_SESSION sessionName

It will tell you the name of the sessson that is shown on the tab.

if you just run dcop $KONSOLE_DCOP_SESSION it will show all the tings you can get and you can set (and yes there is a nice graphocal tool also – kdcop – but thats a separate thing). And the interesting here is teh line

This means that you can set the title to anyting you whant. So after realising this I cerated a scipt that i now use for all the different system i regularly connect to.

This alows me to set a short name for the conneciton.

One thought on “Having fun with dcop

  1. Pingback: A Linux User in a Windows World » Blog Archive » Setting up ssh-agent on ubuntu/kubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.