[Konsole-devel] Controlling konsole with dbus

Andreas 'ads' Scherbaum adsmail at wars-nicht.de
Sun Feb 7 00:03:25 UTC 2010


Hello all,

i'm trying to port a script from KDE3/dcop to KDE4/dbus and ran into
some issues and missing functionality. Even the people from the #kde
irc channel could not help here.

In short, what i want to do: open a new konsole window, resize the
new window, create several new tabs, execute a command in each tab.

Here's what i used back in KDE3 days with dcop:


# start a new konsole window
konsole=$(dcopstart konsole-script)

# maximize the new window
dcop $konsole konsole-mainwindow#1 maximize

# get current session for the first (just created) window
thissession=$(dcop $konsole konsole currentSession)

# create another konsole tab
newsession=`dcop $konsole konsole newSession "ssh -t $s"`

# start the command
dcop $konsole $newsession sendSession "exec <command>"


The script is way more complex, i just broke this example down to the
basic functionality.



I know that i can start a new konsole window with the following command:

qdbus org.kde.konsole /MainApplication newInstance

But i don't have any reference about the newly created window nor do i
know, how to control this specific window.

With:

qdbus org.kde.konsole /Konsole newSession

i can create a new tab - but this tab is always created in the very
first konsole window. How can i create a new tab in my newly created
window?

How can i find the newly created tabs and execute a specific command in
it?


I can't find any good documentation about dbus & KDE - it's problematic
to use dbus, if there's no documentation. Given that dbus seems to be
the replacement for dcop and controls almost everything in KDE4, this
isn't a good start for writing applications.



Thank you & kind regards

-- 
				Andreas 'ads' Scherbaum
Failure is not an option. It comes bundled with your Microsoft product.
 (Ferenc Mantfeld)



More information about the konsole-devel mailing list