LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   multiple konsole tabs via dcop (http://www.linuxquestions.org/questions/linux-software-2/multiple-konsole-tabs-via-dcop-543636/)

nilleso 04-05-2007 03:10 PM

multiple konsole tabs via dcop
 
Hi. I've just discovered scripting konsole actions via dcop and I like it! I have one frustration though. Any of my scripts which open multiple tabs(sessions) always result in an unwanted first tab.
For example, the script below result in three tabs... one connected to the localhost, and one for each of xyz and 123.

Code:

#!/bin/sh
konsole=$(dcopstart konsole-script)

session=$(dcop $konsole konsole newSession)
dcop $konsole $session renameSession xyz
dcop $konsole $session sendSession "ssh user@xyz"

session=$(dcop $konsole konsole newSession)
dcop $konsole $session renameSession 123
dcop $konsole $session sendSession "ssh user@123"

What is the code to make use of that first localhost tab or eliminate it?
Also is there any good sources of dcop (especially konsole control) script examples? Any tips or tricks are much appreciated!

cheers :)

nilleso 04-08-2007 05:38 PM

I figured it out. It seems I just needed to address the sessions more directly as in the example below.
Code:

#!/bin/sh
konsole=$(dcopstart konsole-script)
dcop $konsole session-1 renameSession xyz
dcop $konsole session-1 sendSession "ssh user@xyz"

cheers :)


All times are GMT -5. The time now is 04:09 PM.