Thursday, September 18, 2003

DCOP

DCOP rules

Found this on comp.os.linux.advocacy:

"I'd like to take this opportunity to draw attention to the DCOP feature,
which I feel may be overlooked. It'll also add a bit of advocacy to
this forum, for a change. OK, so it's more KDE advocacy, but what the
hell :-)

Having a GUI is nice, but sometimes it can be beneficial to be able to
control the GUI from the command line. This allows for scripting stuff
like logouts, or helping someone on a remote site.

I'll give you an example. A few days ago my mom called me about some
problem with the computer. Her explanation was something along the
lines of "the gray thing on the bottom of the screen is acting weird".

Okay ... So I eventually reconstruct the events, and it seems like she
may have panicked when she accidentally dragged the panel to a different
position, and somehow also managed to resize it (that one really had me
puzzled). She used to do the same thing in Windows, from time to time.
For a few minutes I try to explain how to set things straight, but in
the end it's just too difficult to explain over the phone.

Well, it's DCOP to the rescue! First I log into her computer, and su to
her account. Then I export the DISPLAY variable, so DCOP knows where
it's supposed to act. I could also have used '--user ' on
every command. Then I run 'dcop' to see what's running in KDE.
'kicker' is the application that handles the panel, so 'dcop kicker'
shows what interfaces I have to it. 'Panel' is obviously what I want,
so to show the available commands, I type 'dcop kicker Panel'.

Once I got that far, I thought I'd see why she was complaining about it
"acting weird", so I called the 'panelSize' and 'panelPosition'
functions. The panel was on the right side of the screen, and
apparently 453 pixels wide (or little less than half the screen). Weird
doesn't describe it well enough ...

Anyways, I checked out what the values were on my system, and set hers
accordingly with 'dcop kicker Panel setPanelSize 46' and 'dcop kicker
Panel setPanelPosition 3'. Then I ran 'dcop kdesktop KDesktopIface
rearrangeIcons', to correct the icon mess that had resulted from the
incident.

I only dread the time I would have had to spend on this trivial issue,
if she had still been using Windows ...

--
PeKaJe"