8 September 2004

Simple DCOP Shell Script for Konsole to Open Multiple Sessions

Posted under: at 00:26

After having a few dozens servers, just opening remote shell to each servers is becoming tedious. This is a simple shell script I wrote to open multiple session on the running Konsole. Put the sessions you want to open in $SESSION variable, and make sure you have the sessions already created in Konsole:

#!/bin/sh
 SESSIONS="root@server1 root@server2 root@server3"
 HEIGHT=575
 WIDTH=890
 KONSOLE=`dcopclient $KONSOLE_DCOP`
 CURSESSION=$KONSOLE_DCOP_SESSION
 dcop $KONSOLE 'konsole-mainwindow#1' resize $WIDTH $HEIGHT
 for A in $SESSIONS ; do
     NEWSESSION=`dcop $KONSOLE konsole newSession $A`
     SIMPLE=`echo $A | sed 's/..*//g'`
     dcop $KONSOLE $NEWSESSION renameSession $SIMPLE
 done
 dcop $CURSESSION closeSession

8 Responses

Trackback: Use this URI to trackback this entry. Use your web browser's function to copy it to your blog posting.

Comment RSS: You can track conversation in this page by using this page's Comments RSS (XML)

Gravatar: You can have a picture next to each of your comments by getting a Gravatar.

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Warning: Comments carrying links to questionable sites will be removed!